@gitlab/eslint-plugin 21.5.0 → 22.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/CHANGELOG.md +217 -0
  2. package/README.md +16 -11
  3. package/docs/development.md +2 -1
  4. package/docs/usage.md +158 -47
  5. package/eslint9/index.js +6 -7
  6. package/lib/configs/base/best-practices.js +0 -4
  7. package/lib/configs/base/es6.js +0 -12
  8. package/lib/configs/base/imports.js +0 -9
  9. package/lib/configs/base/node.js +0 -4
  10. package/lib/confusing-browser-globals.js +68 -0
  11. package/lib/flat-configs/base.js +122 -0
  12. package/lib/flat-configs/default.js +13 -0
  13. package/lib/flat-configs/i18n.js +14 -0
  14. package/lib/flat-configs/jest.js +20 -0
  15. package/lib/flat-configs/tailwind.js +19 -0
  16. package/{eslint9/configs → lib/flat-configs}/typescript.js +47 -62
  17. package/lib/flat-configs/vue.js +16 -0
  18. package/lib/index.js +30 -39
  19. package/lib/plugin.js +32 -0
  20. package/lib/prettier-rules.js +10 -0
  21. package/lib/rules/no-runtime-template-compiler.js +5 -2
  22. package/lib/rules/vue-no-new-non-primitive-in-template.js +1 -1
  23. package/lib/rules/vue-no-undef-apollo-properties.js +1 -1
  24. package/lib/rules/vue-prefer-dollar-scopedslots.js +1 -1
  25. package/lib/rules/vue-require-required-key.js +1 -1
  26. package/lib/rules/vue-slot-name-casing.js +2 -2
  27. package/lib/vue-fragments.js +111 -0
  28. package/package.json +29 -11
  29. package/scripts/generateRuleMapFixtures.js +75 -0
  30. package/scripts/helpers/getConfigs.js +13 -6
  31. package/scripts/updateFiles.js +30 -6
  32. package/eslint9/configs/base.js +0 -140
  33. package/lib/configs/base.js +0 -115
  34. package/lib/configs/default.js +0 -17
  35. package/lib/configs/i18n.js +0 -10
  36. package/lib/configs/jest.js +0 -21
  37. package/lib/configs/tailwind.js +0 -10
  38. package/lib/configs/typescript.js +0 -95
  39. package/lib/configs/vue.js +0 -91
@@ -0,0 +1,122 @@
1
+ const globals = require('globals');
2
+ const unicornPlugin = require('eslint-plugin-unicorn');
3
+ const promisePlugin = require('eslint-plugin-promise');
4
+ const importPlugin = require('eslint-plugin-import');
5
+
6
+ const confusingBrowserGlobals = require('../confusing-browser-globals');
7
+ const gitlabPlugin = require('../plugin.js');
8
+ const prettierRules = require('../prettier-rules');
9
+
10
+ const bestPractices = require('../configs/base/best-practices');
11
+ const errors = require('../configs/base/errors');
12
+ const node = require('../configs/base/node');
13
+ const style = require('../configs/base/style');
14
+ const variables = require('../configs/base/variables');
15
+ const es6 = require('../configs/base/es6');
16
+ const imports = require('../configs/base/imports');
17
+ const strict = require('../configs/base/strict');
18
+
19
+ /*
20
+ Rules related to the GitLab JavaScript style guide.
21
+ Vue-specific rules live in lib/flat-configs/vue.js
22
+ */
23
+ module.exports = [
24
+ {
25
+ languageOptions: {
26
+ globals: {
27
+ ...globals.browser,
28
+ ...globals.es2020,
29
+ ...globals.es2015,
30
+ ...globals.node,
31
+ },
32
+ ecmaVersion: 'latest',
33
+ sourceType: 'module',
34
+ },
35
+ plugins: {
36
+ unicorn: unicornPlugin,
37
+ promise: promisePlugin,
38
+ import: importPlugin,
39
+ '@gitlab': gitlabPlugin,
40
+ },
41
+ settings: imports.settings,
42
+ },
43
+ /*
44
+ One config object per rule set, not one merged `rules` block: a
45
+ severity-only override later in the array (`'no-restricted-syntax': 'off'`)
46
+ keeps the options it inherits from an earlier object. Merging these would
47
+ strip the inherited options from 56 rules at unchanged severity.
48
+ */
49
+ { rules: bestPractices.rules },
50
+ { rules: errors.rules },
51
+ { rules: node.rules },
52
+ { rules: style.rules },
53
+ { rules: variables.rules },
54
+ { rules: es6.rules },
55
+ { rules: imports.rules },
56
+ { rules: strict.rules },
57
+ { rules: promisePlugin.configs['flat/recommended'].rules },
58
+ { rules: prettierRules },
59
+ {
60
+ rules: {
61
+ camelcase: ['error', { properties: 'never', ignoreDestructuring: true }],
62
+ 'default-param-last': 'off',
63
+ 'arrow-body-style': 'off',
64
+ 'unicorn/filename-case': ['error', { case: 'snakeCase' }],
65
+ 'unicorn/no-array-callback-reference': 'error',
66
+ 'import/prefer-default-export': 'off',
67
+ 'import/no-default-export': 'error',
68
+ 'import/no-deprecated': 'error',
69
+ 'import/no-dynamic-require': ['error', { esmodule: true }],
70
+ 'no-implicit-coercion': ['error', { boolean: true, number: true, string: true }],
71
+ 'no-param-reassign': [
72
+ 'error',
73
+ {
74
+ props: true,
75
+ ignorePropertyModificationsFor: ['acc', 'accumulator', 'el', 'element', 'state'],
76
+ },
77
+ ],
78
+ 'no-restricted-exports': [
79
+ 'error',
80
+ {
81
+ restrictedNamedExports: [
82
+ 'then', // avoid confusion when used with dynamic `import()` promise
83
+ ],
84
+ },
85
+ ],
86
+ 'no-restricted-syntax': 'off',
87
+ 'no-sequences': ['error', { allowInParentheses: false }],
88
+ 'promise/catch-or-return': ['error', { allowFinally: true }],
89
+ 'no-restricted-globals': [
90
+ 'error',
91
+ {
92
+ name: 'isFinite',
93
+ message:
94
+ 'Use Number.isFinite instead https://github.com/airbnb/javascript#standard-library--isfinite',
95
+ },
96
+ {
97
+ name: 'isNaN',
98
+ message:
99
+ 'Use Number.isNaN instead https://github.com/airbnb/javascript#standard-library--isnan',
100
+ },
101
+ {
102
+ name: 'escape',
103
+ message:
104
+ "The global `escape` function is unsafe. Did you mean to use `encodeURI`, `encodeURIComponent` or lodash's `escape` instead?",
105
+ },
106
+ {
107
+ name: 'unescape',
108
+ message:
109
+ "The global `unescape` function is unsafe. Did you mean to use `decodeURI`, `decodeURIComponent` or lodash's `unescape` instead?",
110
+ },
111
+ ].concat(confusingBrowserGlobals),
112
+ 'import/order': [
113
+ 'error',
114
+ {
115
+ groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
116
+ },
117
+ ],
118
+ // https://docs.gitlab.com/ee/development/fe_guide/style/javascript.html#limit-number-of-parameters
119
+ 'max-params': ['error', { max: 3 }],
120
+ },
121
+ },
122
+ ];
@@ -0,0 +1,13 @@
1
+ const base = require('./base');
2
+ const { presetAndSetup, gitlabRules } = require('../vue-fragments');
3
+
4
+ /*
5
+ The GitLab JavaScript and Vue rules combined. This is the config most
6
+ consumers want.
7
+
8
+ Not `[...base, ...vue]`. base already contributes eslint-config-prettier, and
9
+ it lands *before* the vue preset here, where lib/flat-configs/vue.js puts it
10
+ after -- so six vue formatting rules stay at the preset's `warn` in this
11
+ config and are `off` in vue. That asymmetry is inherited, not a bug.
12
+ */
13
+ module.exports = [...base, ...presetAndSetup, ...gitlabRules];
@@ -0,0 +1,14 @@
1
+ const gitlabPlugin = require('../plugin.js');
2
+
3
+ module.exports = [
4
+ {
5
+ plugins: { '@gitlab': gitlabPlugin },
6
+ rules: {
7
+ '@gitlab/require-i18n-strings': 'error',
8
+ '@gitlab/vue-require-i18n-attribute-strings': 'error',
9
+ '@gitlab/vue-require-i18n-strings': 'error',
10
+ '@gitlab/require-valid-i18n-helpers': 'error',
11
+ '@gitlab/vue-require-valid-i18n-helpers': 'error',
12
+ },
13
+ },
14
+ ];
@@ -0,0 +1,20 @@
1
+ const jestPlugin = require('eslint-plugin-jest');
2
+
3
+ module.exports = [
4
+ jestPlugin.configs['flat/recommended'],
5
+ {
6
+ rules: {
7
+ 'jest/consistent-test-it': ['error', { fn: 'it', withinDescribe: 'it' }],
8
+ 'jest/no-conditional-expect': 'off',
9
+ 'jest/valid-title': ['error', { ignoreTypeOfDescribeName: true }],
10
+ 'jest/no-restricted-matchers': [
11
+ 'error',
12
+ {
13
+ toBeFalsy: 'Prefer a stronger matcher like `toBe(false)`',
14
+ toBeTruthy: 'Prefer a stronger matcher like `toBe(true)`',
15
+ },
16
+ ],
17
+ 'jest/prefer-to-have-length': 'error',
18
+ },
19
+ },
20
+ ];
@@ -0,0 +1,19 @@
1
+ const tailwindPlugin = require('eslint-plugin-tailwindcss');
2
+
3
+ const gitlabPlugin = require('../plugin.js');
4
+
5
+ module.exports = [
6
+ {
7
+ plugins: {
8
+ '@gitlab': gitlabPlugin,
9
+ tailwindcss: tailwindPlugin,
10
+ },
11
+ rules: {
12
+ '@gitlab/tailwind-no-interpolation': 'error',
13
+ '@gitlab/vue-tailwind-no-interpolation': 'error',
14
+ '@gitlab/tailwind-no-max-width-media-queries': 'error',
15
+ '@gitlab/vue-tailwind-no-max-width-media-queries': 'error',
16
+ 'tailwindcss/no-arbitrary-value': 'error',
17
+ },
18
+ },
19
+ ];
@@ -1,98 +1,83 @@
1
- const baseConfig = require('./base');
2
- const tsEslint = require('@typescript-eslint/eslint-plugin');
1
+ const js = require('@eslint/js');
2
+ const tsPlugin = require('@typescript-eslint/eslint-plugin');
3
3
  const tsParser = require('@typescript-eslint/parser');
4
+ const importPlugin = require('eslint-plugin-import');
4
5
  const globals = require('globals');
5
6
 
6
- const tsConfig = [
7
+ const base = require('./base');
8
+
9
+ /*
10
+ Rules related to the GitLab TypeScript style guide.
11
+ Base JavaScript rules live in lib/flat-configs/base.js
12
+
13
+ Two things here are load-bearing:
14
+
15
+ 1. base is spread first and the `.ts` layer second, so eslint:recommended and
16
+ the TypeScript preset win over eslint-config-prettier inside .ts files,
17
+ as eslintrc's `overrides` did. Putting prettier last would not.
18
+
19
+ 2. `flat/eslint-recommended` is spread alongside `strict`, because eslintrc's
20
+ `plugin:@typescript-eslint/strict` extended it. Without it, 19 core rules
21
+ that a TypeScript-aware replacement or the compiler already covers stay
22
+ enabled.
23
+ */
24
+ const tsEslintRecommended = tsPlugin.configs['flat/eslint-recommended'];
25
+ const tsStrict = tsPlugin.configs.strict;
26
+ const importTypescript = importPlugin.flatConfigs.typescript;
27
+
28
+ module.exports = [
29
+ ...base,
7
30
  {
31
+ name: '@gitlab/typescript/setup',
8
32
  languageOptions: {
9
33
  globals: {
10
- ...baseConfig.languageOptions.globals,
11
34
  ...globals.mocha,
12
35
  ...globals.jest,
13
36
  },
14
- ecmaVersion: baseConfig.languageOptions.ecmaVersion,
15
- sourceType: baseConfig.languageOptions.sourceType,
16
- parserOptions: baseConfig.languageOptions.parserOptions || {},
17
- },
18
- plugins: {
19
- ...baseConfig.plugins,
20
- },
21
- settings: {
22
- ...baseConfig.settings,
23
37
  },
24
38
  rules: {
25
- ...baseConfig.rules,
39
+ 'import/extensions': [
40
+ 'error',
41
+ 'ignorePackages',
42
+ { js: 'never', jsx: 'never', ts: 'never', tsx: 'never' },
43
+ ],
26
44
  },
27
45
  },
28
- // TypeScript-specific config
29
46
  {
30
- files: ['**/*.ts', '**/*.tsx'],
47
+ name: '@gitlab/typescript/ts',
48
+ files: ['**/*.ts'],
31
49
  languageOptions: {
32
50
  parser: tsParser,
33
51
  parserOptions: {
34
52
  project: ['./tsconfig.json'],
35
- tsconfigRootDir: process.cwd(),
36
53
  },
37
54
  },
38
55
  plugins: {
39
- '@typescript-eslint': tsEslint,
56
+ '@typescript-eslint': tsPlugin,
57
+ import: importPlugin,
40
58
  },
41
- settings: {
42
- 'import/resolver': {
43
- node: {
44
- extensions: ['.mjs', '.js', '.json', '.node', '.ts', '.tsx'],
45
- },
46
- },
59
+ linterOptions: {
60
+ reportUnusedDisableDirectives: true,
47
61
  },
62
+ settings: importTypescript.settings,
48
63
  rules: {
49
- 'import/extensions': [
50
- 'error',
51
- 'ignorePackages',
52
- {
53
- js: 'never',
54
- jsx: 'never',
55
- ts: 'never',
56
- tsx: 'never',
57
- },
58
- ],
64
+ ...js.configs.recommended.rules,
65
+ ...tsEslintRecommended.rules,
66
+ ...tsStrict.rules,
67
+ ...importTypescript.rules,
59
68
  semi: [2, 'always'],
60
69
  'max-params': 'off',
61
70
  'no-throw-literal': 'off',
62
71
  'no-shadow': 'off',
63
72
  'no-empty-function': 'off',
64
73
  'no-plusplus': 'off',
65
- 'no-unused-vars': 'off',
66
- 'no-await-in-loop': 'error',
67
74
  'unicorn/no-array-callback-reference': 'off',
68
- 'generator-star-spacing': 'off',
69
- 'max-len': 'off',
70
- 'no-console': 'warn',
71
- 'indent': 'off',
72
- 'quotes': 'off',
73
- 'implicit-arrow-linebreak': 'off',
74
- 'function-paren-newline': 'off',
75
- 'no-redeclare': 'off',
76
- 'brace-style': 'off',
77
- 'no-undef': 'off',
78
- 'no-tabs': 'off',
79
- 'operator-linebreak': 'off',
80
- 'no-confusing-arrow': 'off',
81
- 'object-curly-newline': 'off',
82
75
  '@typescript-eslint/only-throw-error': 'error',
83
76
  '@typescript-eslint/no-unused-vars': 'error',
84
77
  '@typescript-eslint/no-shadow': 'error',
85
78
  '@typescript-eslint/return-await': 'error',
86
79
  '@typescript-eslint/no-floating-promises': 'error',
87
- '@typescript-eslint/no-explicit-any': 'error',
88
- '@typescript-eslint/no-non-null-assertion': 'error',
89
- '@typescript-eslint/no-var-requires': 'error',
90
- '@typescript-eslint/explicit-member-accessibility': [
91
- 'error',
92
- {
93
- accessibility: 'no-public',
94
- },
95
- ],
80
+ '@typescript-eslint/explicit-member-accessibility': ['error', { accessibility: 'no-public' }],
96
81
  'class-methods-use-this': 'off',
97
82
  'import/no-cycle': 'error',
98
83
  'promise/param-names': 'off',
@@ -121,8 +106,10 @@ const tsConfig = [
121
106
  ],
122
107
  },
123
108
  },
124
- // Test files config
125
109
  {
110
+ // Recursive: eslintrc matched a bare `*.test.ts` at any depth, flat globs
111
+ // are path-relative.
112
+ name: '@gitlab/typescript/tests',
126
113
  files: ['**/*.test.ts', '**/*.test.js'],
127
114
  rules: {
128
115
  'max-classes-per-file': 'off',
@@ -130,5 +117,3 @@ const tsConfig = [
130
117
  },
131
118
  },
132
119
  ];
133
-
134
- module.exports = tsConfig;
@@ -0,0 +1,16 @@
1
+ const prettierRules = require('../prettier-rules');
2
+ const { presetAndSetup, gitlabRules } = require('../vue-fragments');
3
+
4
+ /*
5
+ Rules related to the GitLab Vue style guide.
6
+ Base JavaScript rules live in lib/flat-configs/base.js
7
+
8
+ eslint-config-prettier sits between the preset and this package's rules,
9
+ switching the preset's formatting rules off. lib/flat-configs/default.js
10
+ orders it the other way -- see the note there.
11
+ */
12
+ module.exports = [
13
+ ...presetAndSetup,
14
+ { name: '@gitlab/vue/prettier', rules: prettierRules },
15
+ ...gitlabRules,
16
+ ];
package/lib/index.js CHANGED
@@ -1,46 +1,37 @@
1
1
  /**
2
2
  * This file is GENERATED, please run `yarn update` after adding or renaming a rule
3
3
  */
4
+ const plugin = require('./plugin.js');
5
+
6
+ /*
7
+ Getters, so requiring the plugin never loads a config the consumer is not
8
+ using: `typescript` pulls in optional peer dependencies, and eagerly
9
+ requiring it would throw for anyone without the TypeScript toolchain. Getters
10
+ in an object literal are enumerable, so `Object.keys(configs)` is unaffected.
11
+ */
4
12
  module.exports = {
5
- rules: {
6
- 'no-global-event-off': require('./rules/no-global-event-off.js'),
7
- 'no-hardcoded-urls': require('./rules/no-hardcoded-urls.js'),
8
- 'no-runtime-template-compiler': require('./rules/no-runtime-template-compiler.js'),
9
- 'require-i18n-strings': require('./rules/require-i18n-strings.js'),
10
- 'require-valid-i18n-helpers': require('./rules/require-valid-i18n-helpers.js'),
11
- 'tailwind-no-interpolation': require('./rules/tailwind-no-interpolation.js'),
12
- 'tailwind-no-max-width-media-queries': require('./rules/tailwind-no-max-width-media-queries.js'),
13
- 'vtu-no-explicit-wrapper-destroy': require('./rules/vtu-no-explicit-wrapper-destroy.js'),
14
- 'vtu-no-wrapper-vm': require('./rules/vtu-no-wrapper-vm.js'),
15
- 'vue-no-data-toggle': require('./rules/vue-no-data-toggle.js'),
16
- 'vue-no-hardcoded-urls': require('./rules/vue-no-hardcoded-urls.js'),
17
- 'vue-no-new-non-primitive-in-template': require('./rules/vue-no-new-non-primitive-in-template.js'),
18
- 'vue-no-popover-target-dollar-el': require('./rules/vue-no-popover-target-dollar-el.js'),
19
- 'vue-no-undef-apollo-properties': require('./rules/vue-no-undef-apollo-properties.js'),
20
- 'vue-prefer-dollar-scopedslots': require('./rules/vue-prefer-dollar-scopedslots.js'),
21
- 'vue-require-i18n-attribute-strings': require('./rules/vue-require-i18n-attribute-strings.js'),
22
- 'vue-require-i18n-strings': require('./rules/vue-require-i18n-strings.js'),
23
- 'vue-require-required-key': require('./rules/vue-require-required-key.js'),
24
- 'vue-require-valid-i18n-helpers': require('./rules/vue-require-valid-i18n-helpers.js'),
25
- 'vue-slot-name-casing': require('./rules/vue-slot-name-casing.js'),
26
- 'vue-tailwind-no-interpolation': require('./rules/vue-tailwind-no-interpolation.js'),
27
- 'vue-tailwind-no-max-width-media-queries': require('./rules/vue-tailwind-no-max-width-media-queries.js'),
28
- },
13
+ ...plugin,
29
14
  configs: {
30
- base: require('./configs/base.js'),
31
- 'best-practices': require('./configs/base/best-practices.js'),
32
- errors: require('./configs/base/errors.js'),
33
- es6: require('./configs/base/es6.js'),
34
- imports: require('./configs/base/imports.js'),
35
- node: require('./configs/base/node.js'),
36
- strict: require('./configs/base/strict.js'),
37
- style: require('./configs/base/style.js'),
38
- variables: require('./configs/base/variables.js'),
39
- default: require('./configs/default.js'),
40
- i18n: require('./configs/i18n.js'),
41
- jest: require('./configs/jest.js'),
42
- tailwind: require('./configs/tailwind.js'),
43
- typescript: require('./configs/typescript.js'),
44
- vue: require('./configs/vue.js'),
15
+ get base() {
16
+ return require('./flat-configs/base.js');
17
+ },
18
+ get default() {
19
+ return require('./flat-configs/default.js');
20
+ },
21
+ get i18n() {
22
+ return require('./flat-configs/i18n.js');
23
+ },
24
+ get jest() {
25
+ return require('./flat-configs/jest.js');
26
+ },
27
+ get tailwind() {
28
+ return require('./flat-configs/tailwind.js');
29
+ },
30
+ get typescript() {
31
+ return require('./flat-configs/typescript.js');
32
+ },
33
+ get vue() {
34
+ return require('./flat-configs/vue.js');
35
+ },
45
36
  },
46
37
  };
package/lib/plugin.js ADDED
@@ -0,0 +1,32 @@
1
+ /**
2
+ * This file is GENERATED, please run `yarn update` after adding or renaming a rule
3
+ */
4
+ const { name, version } = require('../package.json');
5
+
6
+ module.exports = {
7
+ meta: { name, version },
8
+ rules: {
9
+ 'no-global-event-off': require('./rules/no-global-event-off.js'),
10
+ 'no-hardcoded-urls': require('./rules/no-hardcoded-urls.js'),
11
+ 'no-runtime-template-compiler': require('./rules/no-runtime-template-compiler.js'),
12
+ 'require-i18n-strings': require('./rules/require-i18n-strings.js'),
13
+ 'require-valid-i18n-helpers': require('./rules/require-valid-i18n-helpers.js'),
14
+ 'tailwind-no-interpolation': require('./rules/tailwind-no-interpolation.js'),
15
+ 'tailwind-no-max-width-media-queries': require('./rules/tailwind-no-max-width-media-queries.js'),
16
+ 'vtu-no-explicit-wrapper-destroy': require('./rules/vtu-no-explicit-wrapper-destroy.js'),
17
+ 'vtu-no-wrapper-vm': require('./rules/vtu-no-wrapper-vm.js'),
18
+ 'vue-no-data-toggle': require('./rules/vue-no-data-toggle.js'),
19
+ 'vue-no-hardcoded-urls': require('./rules/vue-no-hardcoded-urls.js'),
20
+ 'vue-no-new-non-primitive-in-template': require('./rules/vue-no-new-non-primitive-in-template.js'),
21
+ 'vue-no-popover-target-dollar-el': require('./rules/vue-no-popover-target-dollar-el.js'),
22
+ 'vue-no-undef-apollo-properties': require('./rules/vue-no-undef-apollo-properties.js'),
23
+ 'vue-prefer-dollar-scopedslots': require('./rules/vue-prefer-dollar-scopedslots.js'),
24
+ 'vue-require-i18n-attribute-strings': require('./rules/vue-require-i18n-attribute-strings.js'),
25
+ 'vue-require-i18n-strings': require('./rules/vue-require-i18n-strings.js'),
26
+ 'vue-require-required-key': require('./rules/vue-require-required-key.js'),
27
+ 'vue-require-valid-i18n-helpers': require('./rules/vue-require-valid-i18n-helpers.js'),
28
+ 'vue-slot-name-casing': require('./rules/vue-slot-name-casing.js'),
29
+ 'vue-tailwind-no-interpolation': require('./rules/vue-tailwind-no-interpolation.js'),
30
+ 'vue-tailwind-no-max-width-media-queries': require('./rules/vue-tailwind-no-max-width-media-queries.js'),
31
+ },
32
+ };
@@ -0,0 +1,10 @@
1
+ const prettierConfig = require('eslint-config-prettier');
2
+
3
+ /*
4
+ eslint-config-prettier v10 also turns off `@stylistic/*` rules. This package
5
+ does not register that plugin, so those 180 entries are dropped. Consumers
6
+ using `@stylistic` should apply eslint-config-prettier themselves.
7
+ */
8
+ module.exports = Object.fromEntries(
9
+ Object.entries(prettierConfig.rules).filter(([rule]) => !rule.startsWith('@stylistic/')),
10
+ );
@@ -2,7 +2,7 @@
2
2
  // Requirements
3
3
  // ------------------------------------------------------------------------------
4
4
  const { DOCS_BASE_URL } = require('../constants');
5
- const utils = require('eslint-plugin-vue/lib/utils');
5
+ const utils = require('eslint-plugin-vue/dist/utils').default;
6
6
 
7
7
  // ------------------------------------------------------------------------------
8
8
  // Rule Definition
@@ -30,7 +30,10 @@ module.exports = {
30
30
 
31
31
  return {
32
32
  ...utils.executeOnVue(context, (node, type) => {
33
- if (type === 'definition' && utils.getVueComponentDefinitionType(node) === 'mixin') {
33
+ if (
34
+ type === 'definition' &&
35
+ utils.getVueComponentDefinitionType(context, node) === 'mixin'
36
+ ) {
34
37
  return;
35
38
  }
36
39
 
@@ -1,7 +1,7 @@
1
1
  // ------------------------------------------------------------------------------
2
2
  // Requirements
3
3
  // ------------------------------------------------------------------------------
4
- const utils = require('eslint-plugin-vue/lib/utils');
4
+ const utils = require('eslint-plugin-vue/dist/utils').default;
5
5
  const { pickBy, identity } = require('lodash');
6
6
  const { DOCS_BASE_URL } = require('../constants');
7
7
  const { closest, NODE_TYPES } = require('../utils/rule-utils');
@@ -2,7 +2,7 @@
2
2
  // Requirements
3
3
  // ------------------------------------------------------------------------------
4
4
  const { DOCS_BASE_URL } = require('../constants');
5
- const utils = require('eslint-plugin-vue/lib/utils');
5
+ const utils = require('eslint-plugin-vue/dist/utils').default;
6
6
 
7
7
  // ------------------------------------------------------------------------------
8
8
  // Helpers
@@ -4,7 +4,7 @@
4
4
 
5
5
  const { DOCS_BASE_URL } = require('../constants');
6
6
  const { defineTemplateBodyVisitor } = require('../utils/index');
7
- const utils = require('eslint-plugin-vue/lib/utils');
7
+ const utils = require('eslint-plugin-vue/dist/utils').default;
8
8
 
9
9
  // ------------------------------------------------------------------------------
10
10
  // Helpers
@@ -13,7 +13,7 @@ const NATIVE_TYPES = new Set([
13
13
  'Symbol',
14
14
  ]);
15
15
 
16
- const utils = require('eslint-plugin-vue/lib/utils');
16
+ const utils = require('eslint-plugin-vue/dist/utils').default;
17
17
 
18
18
  module.exports = {
19
19
  meta: {
@@ -4,8 +4,8 @@
4
4
  // Requirements
5
5
  // ------------------------------------------------------------------------------
6
6
 
7
- const utils = require('eslint-plugin-vue/lib/utils');
8
- const casing = require('eslint-plugin-vue/lib/utils/casing');
7
+ const utils = require('eslint-plugin-vue/dist/utils').default;
8
+ const casing = require('eslint-plugin-vue/dist/utils/casing');
9
9
  const { DOCS_BASE_URL } = require('../constants');
10
10
 
11
11
  // ------------------------------------------------------------------------------