@gitlab/eslint-plugin 21.5.0 → 23.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 (45) hide show
  1. package/CHANGELOG.md +299 -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 +1 -13
  8. package/lib/configs/base/imports.js +86 -106
  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/lib/flat-configs/typescript.js +136 -0
  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 +6 -3
  22. package/lib/rules/require-i18n-strings.js +4 -4
  23. package/lib/rules/vtu-no-explicit-wrapper-destroy.js +1 -1
  24. package/lib/rules/vue-no-new-non-primitive-in-template.js +1 -1
  25. package/lib/rules/vue-no-undef-apollo-properties.js +1 -1
  26. package/lib/rules/vue-prefer-dollar-scopedslots.js +1 -1
  27. package/lib/rules/vue-require-required-key.js +1 -1
  28. package/lib/rules/vue-slot-name-casing.js +2 -3
  29. package/lib/utils/hardcoded-urls.js +1 -1
  30. package/lib/utils/string-utils.js +6 -8
  31. package/lib/vue-fragments.js +111 -0
  32. package/package.json +31 -12
  33. package/scripts/benchmarking/checkAllStrings.js +1 -1
  34. package/scripts/helpers/getConfigs.js +15 -6
  35. package/scripts/publish_npm_package.mjs +0 -2
  36. package/scripts/updateFiles.js +30 -6
  37. package/eslint9/configs/base.js +0 -140
  38. package/eslint9/configs/typescript.js +0 -134
  39. package/lib/configs/base.js +0 -115
  40. package/lib/configs/default.js +0 -17
  41. package/lib/configs/i18n.js +0 -10
  42. package/lib/configs/jest.js +0 -21
  43. package/lib/configs/tailwind.js +0 -10
  44. package/lib/configs/typescript.js +0 -95
  45. package/lib/configs/vue.js +0 -91
@@ -1,91 +0,0 @@
1
- /*
2
- This plugin contains rules related to GitLab Vue style guide
3
- base JavaScript rules are in lib/configs/base.js
4
- */
5
-
6
- module.exports = {
7
- env: {
8
- browser: true,
9
- es2020: true,
10
- },
11
- extends: ['plugin:vue/recommended', 'prettier'],
12
- parserOptions: {
13
- parser: 'espree',
14
- ecmaVersion: 'latest',
15
- },
16
- plugins: ['unicorn', 'promise', 'import', '@gitlab'],
17
- rules: {
18
- 'vue/html-self-closing': [
19
- 'error',
20
- {
21
- html: {
22
- void: 'any',
23
- normal: 'never',
24
- component: 'always',
25
- },
26
- svg: 'always',
27
- math: 'always',
28
- },
29
- ],
30
- 'vue/component-tags-order': [
31
- 'error',
32
- {
33
- order: ['script', 'template', 'style'],
34
- },
35
- ],
36
- // Turning this off for now as we violate this rule in many places.
37
- 'vue/max-attributes-per-line': 'off',
38
- 'vue/component-options-name-casing': ['error', 'PascalCase'],
39
- 'vue/component-name-in-template-casing': ['error', 'kebab-case'],
40
- '@gitlab/vue-require-required-key': 'error',
41
- 'vue/v-slot-style': [
42
- 'error',
43
- {
44
- atComponent: 'shorthand',
45
- },
46
- ],
47
- '@gitlab/vue-no-data-toggle': 'error',
48
- '@gitlab/vue-no-popover-target-dollar-el': 'warn',
49
- '@gitlab/vue-prefer-dollar-scopedslots': 'error',
50
- '@gitlab/vue-slot-name-casing': 'error',
51
- '@gitlab/no-runtime-template-compiler': 'error',
52
- 'import/order': [
53
- 'error',
54
- {
55
- groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
56
- },
57
- ],
58
- // See https://gitlab.com/gitlab-org/frontend/eslint-plugin/-/issues/52.
59
- 'vue/component-api-style': ['error', ['options']],
60
- // We might not want to enable vue/singleline-html-element-content-newline and vue/multiline-html-element-content-newline
61
- // just yet as they might cause regression depending on how the consumers compile Vue templates.
62
- 'vue/singleline-html-element-content-newline': 'off',
63
- 'vue/multiline-html-element-content-newline': 'off',
64
- // Disabling these as they might conflict with prettier.
65
- 'vue/html-indent': 'off',
66
- 'vue/html-closing-bracket-newline': 'off',
67
- // BEGIN rules to aid migration from Vue 2.x to 3.x.
68
- // See https://gitlab.com/groups/gitlab-org/-/epics/3174 for more details.
69
- 'vue/no-deprecated-data-object-declaration': 'error',
70
- 'vue/no-deprecated-events-api': 'error',
71
- 'vue/no-deprecated-filter': 'error',
72
- 'vue/no-deprecated-functional-template': 'error',
73
- 'vue/no-deprecated-html-element-is': 'error',
74
- 'vue/no-deprecated-inline-template': 'error',
75
- 'vue/no-deprecated-props-default-this': 'error',
76
- 'vue/no-deprecated-scope-attribute': 'error',
77
- 'vue/no-deprecated-slot-attribute': 'error',
78
- 'vue/no-deprecated-slot-scope-attribute': 'error',
79
- 'vue/no-deprecated-v-on-number-modifiers': 'error',
80
- 'vue/no-deprecated-vue-config-keycodes': 'error',
81
- // END rules to aid migration from Vue 2.x to 3.x.
82
- },
83
- overrides: [
84
- {
85
- files: ['**/*.vue'],
86
- rules: {
87
- 'import/no-default-export': 'off',
88
- },
89
- },
90
- ],
91
- };