debian-mirror-gitlab/.eslintrc.yml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

199 lines
6.2 KiB
YAML
Raw Normal View History

2019-05-05 18:10:48 +05:30
extends:
2020-04-22 19:07:51 +05:30
- plugin:@gitlab/default
- plugin:@gitlab/i18n
2020-01-01 13:55:28 +05:30
- plugin:no-jquery/slim
- plugin:no-jquery/deprecated-3.4
2022-10-11 01:57:18 +05:30
- plugin:no-unsanitized/DOM
2021-10-27 15:23:28 +05:30
- ./tooling/eslint-config/conditionally_ignore.js
2019-05-05 18:10:48 +05:30
globals:
__webpack_public_path__: true
gl: false
gon: false
localStorage: false
2019-09-30 21:07:59 +05:30
IS_EE: false
2019-05-05 18:10:48 +05:30
plugins:
2019-12-21 20:55:43 +05:30
- no-jquery
2019-05-05 18:10:48 +05:30
settings:
import/resolver:
webpack:
config: './config/webpack.config.js'
rules:
import/no-commonjs: error
2020-11-24 15:15:51 +05:30
import/no-default-export: off
2019-05-05 18:10:48 +05:30
no-underscore-dangle:
- error
- allow:
- __
- _links
2020-01-01 13:55:28 +05:30
import/no-unresolved:
- error
2022-07-23 23:45:48 +05:30
- ignore:
# In FOSS, these import paths are rewritten using
# NormalModuleReplacementPlugin, which import/no-unresolved doesn't
# consider. See
# https://gitlab.com/gitlab-org/gitlab/-/merge_requests/89831.
- '^(ee|jh)_component/'
2020-05-24 23:13:21 +05:30
# Disabled for now, to make the airbnb-base 12.1.0 -> 13.1.0 update smoother
no-else-return:
- error
- allowElseIf: true
2019-05-05 18:10:48 +05:30
lines-between-class-members: off
2020-01-01 13:55:28 +05:30
# all offenses of no-jquery/no-animate-toggle are false positives ( $toast.show() )
no-jquery/no-animate-toggle: off
no-jquery/no-event-shorthand: off
2019-12-21 20:55:43 +05:30
no-jquery/no-serialize: error
promise/always-return: off
promise/no-callback-in-promise: off
2021-03-11 19:13:27 +05:30
'@gitlab/no-global-event-off': error
2022-07-16 23:28:13 +05:30
'@gitlab/vue-no-new-non-primitive-in-template':
- error
- allowNames:
- 'class(es)?$'
- '^style$'
- '^to$'
- '^$'
- '^variables$'
- 'attrs?$'
2021-04-17 20:07:23 +05:30
no-param-reassign:
- error
- props: true
ignorePropertyModificationsFor:
- acc
- accumulator
- el
- element
- state
ignorePropertyModificationsForRegex:
- '^draft'
2021-03-11 19:13:27 +05:30
import/order:
- error
- groups:
- builtin
- external
- internal
- parent
- sibling
- index
pathGroups:
2023-03-04 22:38:38 +05:30
- pattern: '@sentry/browser'
group: external
2021-03-11 19:13:27 +05:30
- pattern: ~/**
group: internal
- pattern: emojis/**
group: internal
2022-01-26 12:08:38 +05:30
- pattern: '{ee_,jh_,}empty_states/**'
2021-03-11 19:13:27 +05:30
group: internal
2022-01-26 12:08:38 +05:30
- pattern: '{ee_,jh_,}icons/**'
2021-03-11 19:13:27 +05:30
group: internal
2022-01-26 12:08:38 +05:30
- pattern: '{ee_,jh_,}images/**'
2021-03-11 19:13:27 +05:30
group: internal
- pattern: vendor/**
group: internal
- pattern: shared_queries/**
group: internal
- pattern: '{ee_,}spec/**'
group: internal
2022-01-26 12:08:38 +05:30
- pattern: '{ee_,jh_,}jest/**'
2021-03-11 19:13:27 +05:30
group: internal
2022-01-26 12:08:38 +05:30
- pattern: '{ee_,jh_,any_}else_ce/**'
2021-03-11 19:13:27 +05:30
group: internal
- pattern: ee/**
group: internal
2022-01-26 12:08:38 +05:30
- pattern: '{ee_,jh_,}component/**'
group: internal
- pattern: jh_else_ee/**
group: internal
- pattern: jh/**
2021-03-11 19:13:27 +05:30
group: internal
- pattern: '{test_,}helpers/**'
group: internal
- pattern: test_fixtures/**
group: internal
alphabetize:
2021-11-18 22:05:49 +05:30
order: ignore
2022-06-21 17:19:12 +05:30
'no-restricted-syntax':
- error
- selector: ImportSpecifier[imported.name='GlSkeletonLoading']
message: 'Migrate to GlSkeletonLoader, or import GlDeprecatedSkeletonLoading.'
2023-03-04 22:38:38 +05:30
- selector: ImportSpecifier[imported.name='GlSafeHtmlDirective']
message: 'Use directive at ~/vue_shared/directives/safe_html.js instead.'
2022-07-16 23:28:13 +05:30
# See https://gitlab.com/gitlab-org/gitlab/-/issues/360551
vue/multi-word-component-names: off
2022-07-23 23:45:48 +05:30
unicorn/prefer-dom-node-dataset:
- error
2022-10-11 01:57:18 +05:30
no-unsanitized/method:
- error
- escape:
methods: 'sanitize'
no-unsanitized/property:
- error
- escape:
methods: 'sanitize'
2019-09-04 21:01:54 +05:30
overrides:
2020-03-13 15:44:24 +05:30
- files:
2022-04-04 11:22:00 +05:30
- '{,ee/,jh/}spec/frontend*/**/*'
2020-03-13 15:44:24 +05:30
rules:
2021-03-11 19:13:27 +05:30
'@gitlab/require-i18n-strings': off
'@gitlab/no-runtime-template-compiler': off
2022-08-13 15:12:31 +05:30
'import/no-dynamic-require': off
'no-import-assign': off
2022-03-02 08:16:31 +05:30
'no-restricted-syntax':
- error
- selector: CallExpression[callee.object.name=/(wrapper|vm)/][callee.property.name="setData"]
message: 'Avoid using "setData" on VTU wrapper'
2022-04-04 11:22:00 +05:30
- selector: MemberExpression[object.type!='ThisExpression'][property.type='Identifier'][property.name='$nextTick']
message: 'Using $nextTick from a component instance is discouraged. Import nextTick directly from the Vue package.'
2022-05-07 20:08:51 +05:30
- selector: Identifier[name='setImmediate']
message: 'Prefer explicit waitForPromises (or equivalent), or jest.runAllTimers (or equivalent) to vague setImmediate calls.'
2022-06-21 17:19:12 +05:30
- selector: ImportSpecifier[imported.name='GlSkeletonLoading']
message: 'Migrate to GlSkeletonLoader, or import GlDeprecatedSkeletonLoading.'
2022-10-11 01:57:18 +05:30
no-unsanitized/method: off
no-unsanitized/property: off
2021-04-17 20:07:23 +05:30
- files:
- 'config/**/*'
- 'scripts/**/*'
- '*.config.js'
- '*.config.*.js'
2021-11-18 22:05:49 +05:30
- 'jest_resolver.js'
- storybook/config/*.js
2021-04-17 20:07:23 +05:30
rules:
'@gitlab/require-i18n-strings': off
import/no-extraneous-dependencies: off
import/no-commonjs: off
import/no-nodejs-modules: off
filenames/match-regex: off
no-console: off
2021-09-30 23:02:18 +05:30
- files:
- '*.stories.js'
rules:
filenames/match-regex: off
2023-01-13 00:05:48 +05:30
'@gitlab/require-i18n-strings': off
2021-12-11 22:18:48 +05:30
- files:
- '*.graphql'
plugins:
- '@graphql-eslint'
parserOptions:
parser: '@graphql-eslint/eslint-plugin'
operations:
2022-01-26 12:08:38 +05:30
- '{,ee/,jh/}app/**/*.graphql'
2022-07-16 23:28:13 +05:30
schema: './tmp/tests/graphql/gitlab_schema_apollo.graphql'
2021-12-11 22:18:48 +05:30
rules:
filenames/match-regex: off
spaced-comment: off
# TODO: We need a way to include this rule + support ee_else_ce fragments
#'@graphql-eslint/unique-fragment-name': error
# TODO: Uncomment these rules when then `schema` is available
#'@graphql-eslint/fragments-on-composite-type': error
#'@graphql-eslint/known-argument-names': error
#'@graphql-eslint/known-type-names': error
'@graphql-eslint/no-anonymous-operations': error
'@graphql-eslint/unique-operation-name': error
2022-01-26 12:08:38 +05:30
'@graphql-eslint/require-id-when-available': error
2022-08-27 11:52:29 +05:30
'@graphql-eslint/no-unused-variables': error
'@graphql-eslint/no-unused-fragments': error
'@graphql-eslint/no-duplicate-fields': error
- files:
2023-03-04 22:38:38 +05:30
- '{,ee/}spec/contracts/consumer/**/*'
2022-08-27 11:52:29 +05:30
rules:
'@gitlab/require-i18n-strings': off