@gitlab/eslint-plugin 10.0.2 → 12.0.1

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.
package/.tool-versions ADDED
@@ -0,0 +1,2 @@
1
+ nodejs 16.14.0
2
+ yarn 1.22.17
package/CHANGELOG.md CHANGED
@@ -1,3 +1,36 @@
1
+ ## [12.0.1](https://gitlab.com/gitlab-org/frontend/eslint-plugin/compare/v12.0.0...v12.0.1) (2022-03-28)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * remove duplicate rule camelcase ([9f0523a](https://gitlab.com/gitlab-org/frontend/eslint-plugin/commit/9f0523a5cc6d0d94c8df9618e567c4a4a847287e))
7
+
8
+ # [12.0.0](https://gitlab.com/gitlab-org/frontend/eslint-plugin/compare/v11.0.0...v12.0.0) (2022-03-28)
9
+
10
+
11
+ ### Features
12
+
13
+ * migrate to @babel/eslint-parser ([cbaa880](https://gitlab.com/gitlab-org/frontend/eslint-plugin/commit/cbaa8803dfdd9295bf0334868fe0a0100806aa33))
14
+ * replace plugin-filenames with plugin-unicorn ([1e4df68](https://gitlab.com/gitlab-org/frontend/eslint-plugin/commit/1e4df689311ccdc4c46e6d9889069133a109255a))
15
+
16
+
17
+ ### BREAKING CHANGES
18
+
19
+ * - `babel/camelcase` rule is builtin in ESLint now as `camelcase`.
20
+ - The minimum required Node.js version is 14.
21
+
22
+ # [11.0.0](https://gitlab.com/gitlab-org/frontend/eslint-plugin/compare/v10.0.2...v11.0.0) (2022-02-22)
23
+
24
+
25
+ ### Features
26
+
27
+ * remove unused rule vue-emit-events-with-two-args ([f9a4ddc](https://gitlab.com/gitlab-org/frontend/eslint-plugin/commit/f9a4ddc967f163bd6aa9503b5c0cf86be28617dc))
28
+
29
+
30
+ ### BREAKING CHANGES
31
+
32
+ * rule 'vue-emit-events-with-two-args' was removed.
33
+
1
34
  ## [10.0.2](https://gitlab.com/gitlab-org/frontend/eslint-plugin/compare/v10.0.1...v10.0.2) (2022-01-12)
2
35
 
3
36
 
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- [![pipeline status](https://gitlab.com/gitlab-org/frontend/eslint-plugin/badges/master/pipeline.svg)](https://gitlab.com/gitlab-org/frontend/eslint-plugin/commits/master)
1
+ [![pipeline status](https://gitlab.com/gitlab-org/frontend/eslint-plugin/badges/main/pipeline.svg)](https://gitlab.com/gitlab-org/frontend/eslint-plugin/commits/main)
2
2
  [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
3
3
 
4
4
  # @gitlab/eslint-plugin
@@ -32,4 +32,4 @@ All the current rule tests are available in the `tests/lib/rules` directory.
32
32
 
33
33
  ### Util tests
34
34
 
35
- These utilities are useful to simplify writing new tests and can be found in the `test/lib/utils` directory.
35
+ These utilities are useful to simplify writing new tests and can be found in the `test/lib/utils` directory.
@@ -90,5 +90,5 @@ If you don't need to externalize string literals in your project.
90
90
 
91
91
  ## Further Reading
92
92
 
93
- - Code implementation of valid and invalid examples being tested: https://gitlab.com/gitlab-org/frontend/eslint-plugin/blob/master/tests/lib/rules/require-i18n-strings.js
93
+ - Code implementation of valid and invalid examples being tested: https://gitlab.com/gitlab-org/frontend/eslint-plugin/blob/main/tests/lib/rules/require-i18n-strings.js
94
94
  - Original GitLab CE issue which triggered this: https://gitlab.com/gitlab-org/gitlab-ce/issues/57970
package/docs/rules.md CHANGED
@@ -8,7 +8,6 @@ Available rules:
8
8
  - [no-runtime-template-compiler](./rules/no-runtime-template-compiler.md): Disallow components which rely on a runtime template compiler.
9
9
  - [require-i18n-strings](./rules/require-i18n-strings.md): Detect a string which has been hard coded and requires externalization.
10
10
  - [require-valid-i18n-helpers](./rules/require-valid-i18n-helpers.md): Enforces valid usage of translation helpers in JavaScript.
11
- - [vue-emit-events-with-two-args](./rules/vue-emit-events-with-two-args.md): Throw an error when emit is called with more than two arguments.
12
11
  - [vue-no-data-toggle](./rules/vue-no-data-toggle.md): Restrict the use of `data-toggle` bootstrap behaviors within Vue templates
13
12
  - [vue-no-new-non-primitive-in-template](./rules/vue-no-new-non-primitive-in-template.md): Prevents non-primitive values from being declared in templates
14
13
  - [vue-require-i18n-attribute-strings](./rules/vue-require-i18n-attribute-strings.md): Detect non externalized strings in vue `<template>` attributes
@@ -15,19 +15,18 @@ module.exports = {
15
15
  'plugin:promise/recommended',
16
16
  ],
17
17
  parserOptions: {
18
- parser: 'babel-eslint',
18
+ parser: '@babel/eslint-parser',
19
19
  },
20
- plugins: ['babel', 'filenames', 'promise', 'import', '@gitlab'],
20
+ plugins: ['@babel', 'unicorn', 'promise', 'import', '@gitlab'],
21
21
  rules: {
22
- 'babel/camelcase': [
22
+ camelcase: [
23
23
  'error',
24
24
  {
25
25
  properties: 'never',
26
26
  ignoreDestructuring: true,
27
27
  },
28
28
  ],
29
- camelcase: 'off',
30
- 'filenames/match-regex': ['error', '^[a-z0-9_]+$'],
29
+ 'unicorn/filename-case': ['error', { case: 'snakeCase' }],
31
30
  'import/prefer-default-export': 'off',
32
31
  'import/no-default-export': 'error',
33
32
  'import/no-deprecated': 'error',
package/lib/constants.js CHANGED
@@ -1,3 +1,3 @@
1
1
  module.exports = {
2
- DOCS_BASE_URL: 'https://gitlab.com/gitlab-org/frontend/eslint-plugin/blob/master/docs/rules/',
2
+ DOCS_BASE_URL: 'https://gitlab.com/gitlab-org/frontend/eslint-plugin/blob/main/docs/rules/',
3
3
  };
package/lib/index.js CHANGED
@@ -7,7 +7,6 @@ module.exports = {
7
7
  'no-runtime-template-compiler': require('./rules/no-runtime-template-compiler.js'),
8
8
  'require-i18n-strings': require('./rules/require-i18n-strings.js'),
9
9
  'require-valid-i18n-helpers': require('./rules/require-valid-i18n-helpers.js'),
10
- 'vue-emit-events-with-two-args': require('./rules/vue-emit-events-with-two-args.js'),
11
10
  'vue-no-data-toggle': require('./rules/vue-no-data-toggle.js'),
12
11
  'vue-no-new-non-primitive-in-template': require('./rules/vue-no-new-non-primitive-in-template.js'),
13
12
  'vue-require-i18n-attribute-strings': require('./rules/vue-require-i18n-attribute-strings.js'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/eslint-plugin",
3
- "version": "10.0.2",
3
+ "version": "12.0.1",
4
4
  "description": "GitLab package for our custom eslint rules",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -27,17 +27,19 @@
27
27
  },
28
28
  "homepage": "https://gitlab.com/gitlab-org/frontend/eslint-plugin#readme",
29
29
  "engines": {
30
- "node": ">=8.10.0"
30
+ "node": ">=14"
31
31
  },
32
32
  "dependencies": {
33
- "babel-eslint": "^10.0.3",
33
+ "@babel/core": "^7.17.0",
34
+ "@babel/eslint-parser": "^7.17.0",
35
+ "@babel/eslint-plugin": "^7.17.7",
34
36
  "eslint-config-airbnb-base": "^14.2.1",
35
37
  "eslint-config-prettier": "^6.10.0",
36
38
  "eslint-plugin-babel": "^5.3.0",
37
- "eslint-plugin-filenames": "^1.3.2",
38
39
  "eslint-plugin-import": "^2.22.1",
39
40
  "eslint-plugin-jest": "^23.8.2",
40
41
  "eslint-plugin-promise": "^4.2.1",
42
+ "eslint-plugin-unicorn": "^40.1.0",
41
43
  "eslint-plugin-vue": "^7.5.0",
42
44
  "lodash": "^4.17.21",
43
45
  "vue-eslint-parser": "^7.0.0"
@@ -47,12 +49,15 @@
47
49
  },
48
50
  "devDependencies": {
49
51
  "eslint": "^7.27.0",
50
- "glob": "^7.1.3",
51
- "jest": "^26.6.3",
52
- "prettier": "^2.2.1",
53
- "pretty-quick": "^3.1.0"
52
+ "glob": "^7.2.0",
53
+ "jest": "^27.5.1",
54
+ "prettier": "^2.6.1",
55
+ "pretty-quick": "^3.1.3"
54
56
  },
55
57
  "release": {
58
+ "branches": [
59
+ "main"
60
+ ],
56
61
  "verifyConditions": [
57
62
  "@semantic-release/changelog",
58
63
  "@semantic-release/npm",
@@ -1,38 +0,0 @@
1
- # @gitlab/vue-emit-events-with-two-args
2
-
3
- Throw an error when emit is called with more than two arguments.
4
-
5
- ## Rule Details
6
-
7
- It has been decided to use `mitt` as an event bus implementation and this library does not support argument list as the event arguments, [it expects two arguments only](https://github.com/developit/mitt#emit).
8
-
9
- To pass an argument list, an object should be used as the second argument.
10
-
11
- ### Examples of **incorrect** code for this rule
12
-
13
- `emit` method called with more than two arguments.
14
-
15
- ```javascript
16
- vm.$emit('keyspressed', 'enter', '1');
17
- vm.emit('keyspressed', 'enter', '1');
18
- ```
19
-
20
- ### Examples of **correct** code for this rule
21
-
22
- Pass an object as the second argument to `emit`.
23
-
24
- ```javascript
25
- vm.$emit('keyspressed', { keys: ['enter', '1'] });
26
- vm.emit('keyspressed', { keys: ['enter', '1'] });
27
- ```
28
-
29
- `emit` method called with one argument.
30
-
31
- ```javascript
32
- vm.$emit('focus');
33
- vm.emit('focus');
34
- ```
35
-
36
- ## Options
37
-
38
- Nothing