@gitlab/eslint-plugin 18.3.1 → 19.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.
- package/CHANGELOG.md +26 -0
- package/docs/usage.md +27 -0
- package/lib/configs/default.js +4 -3
- package/package.json +2 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,29 @@
|
|
|
1
|
+
# [19.0.0](https://gitlab.com/gitlab-org/frontend/eslint-plugin/compare/v18.3.2...v19.0.0) (2023-04-19)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* Remove `eslint-plugin-babel` and `@babel/eslint-plugin` ([c27955b](https://gitlab.com/gitlab-org/frontend/eslint-plugin/commit/c27955b0ad9078925547b9ddc48137752e51afde))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Performance Improvements
|
|
10
|
+
|
|
11
|
+
* Switch parser from babel to espree ([b53f2a4](https://gitlab.com/gitlab-org/frontend/eslint-plugin/commit/b53f2a487d73afbc23bfdd922ce13aa2beac79eb))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### BREAKING CHANGES
|
|
15
|
+
|
|
16
|
+
* Remove `eslint-plugin-babel` dependency
|
|
17
|
+
* Remove `@babel/eslint-plugin` dependency
|
|
18
|
+
* Switch parser from `@babel/eslint-parser` to `espree`
|
|
19
|
+
|
|
20
|
+
## [18.3.2](https://gitlab.com/gitlab-org/frontend/eslint-plugin/compare/v18.3.1...v18.3.2) (2023-04-11)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Performance Improvements
|
|
24
|
+
|
|
25
|
+
* Force newer version of jest plugin ([f865af6](https://gitlab.com/gitlab-org/frontend/eslint-plugin/commit/f865af6834e12c89dd0a7ee49c6197ec328cc1c6))
|
|
26
|
+
|
|
1
27
|
## [18.3.1](https://gitlab.com/gitlab-org/frontend/eslint-plugin/compare/v18.3.0...v18.3.1) (2023-04-11)
|
|
2
28
|
|
|
3
29
|
|
package/docs/usage.md
CHANGED
|
@@ -26,6 +26,33 @@ extends:
|
|
|
26
26
|
- 'plugin:@gitlab/default'
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
+
`plugin:@gitlab/default` uses the `espree` parser, shipped with `eslint` under the hood.
|
|
30
|
+
|
|
31
|
+
The configured JS version is `latest`, so eslint should be able to parse even the newest JS syntax.
|
|
32
|
+
You can adjust this behavior as [described here][ecma-version]. For example:
|
|
33
|
+
|
|
34
|
+
```yaml
|
|
35
|
+
parserOptions:
|
|
36
|
+
ecmaVersion: 2020
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
That being said, when it comes to globals, we still assume a `ES2015` environment, which brought us `Set`, `Map`.
|
|
40
|
+
If you need newer globals, you can define newer env as [described here][globals]. For example:
|
|
41
|
+
|
|
42
|
+
```yaml
|
|
43
|
+
env:
|
|
44
|
+
es2022: true
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
If you want to completely swap out the parser (e.g. using a typescript or babel parser), please follow
|
|
48
|
+
the [`eslint` docs][eslint-parser-config] if you only lint JS files,
|
|
49
|
+
and the [`vue-eslint-parser` docs][vue-eslint-parser-config] if you lint VUE files as well.
|
|
50
|
+
|
|
51
|
+
[ecma-version]: https://eslint.org/docs/latest/use/configure/language-options#specifying-parser-options
|
|
52
|
+
[globals]: https://eslint.org/docs/latest/use/configure/language-options#specifying-environments
|
|
53
|
+
[eslint-parser-config]: https://eslint.org/docs/latest/use/configure/parser
|
|
54
|
+
[vue-eslint-parser-config]: https://eslint.vuejs.org/user-guide/#how-to-use-a-custom-parser
|
|
55
|
+
|
|
29
56
|
### `plugin:@gitlab/i18n`
|
|
30
57
|
|
|
31
58
|
Add `plugin:@gitlab/i18n` to the extends section of your `.eslintrc` configuration file.
|
package/lib/configs/default.js
CHANGED
|
@@ -5,7 +5,7 @@ const [, ...restrictedGlobals] = require('eslint-config-airbnb-base/rules/variab
|
|
|
5
5
|
module.exports = {
|
|
6
6
|
env: {
|
|
7
7
|
browser: true,
|
|
8
|
-
|
|
8
|
+
es2015: true,
|
|
9
9
|
},
|
|
10
10
|
extends: [
|
|
11
11
|
'airbnb-base',
|
|
@@ -15,9 +15,10 @@ module.exports = {
|
|
|
15
15
|
'plugin:promise/recommended',
|
|
16
16
|
],
|
|
17
17
|
parserOptions: {
|
|
18
|
-
parser: '
|
|
18
|
+
parser: 'espree',
|
|
19
|
+
ecmaVersion: 'latest',
|
|
19
20
|
},
|
|
20
|
-
plugins: ['
|
|
21
|
+
plugins: ['unicorn', 'promise', 'import', '@gitlab'],
|
|
21
22
|
rules: {
|
|
22
23
|
camelcase: [
|
|
23
24
|
'error',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitlab/eslint-plugin",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "19.0.0",
|
|
4
4
|
"description": "GitLab package for our custom eslint rules",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -30,14 +30,10 @@
|
|
|
30
30
|
"node": ">=14"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@babel/core": "^7.17.0",
|
|
34
|
-
"@babel/eslint-parser": "^7.17.0",
|
|
35
|
-
"@babel/eslint-plugin": "^7.17.7",
|
|
36
33
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
37
34
|
"eslint-config-prettier": "^6.10.0",
|
|
38
|
-
"eslint-plugin-babel": "^5.3.0",
|
|
39
35
|
"eslint-plugin-import": "^2.26.0",
|
|
40
|
-
"eslint-plugin-jest": "^27.
|
|
36
|
+
"eslint-plugin-jest": "^27.2.1",
|
|
41
37
|
"eslint-plugin-promise": "^6.0.1",
|
|
42
38
|
"eslint-plugin-unicorn": "^40.1.0",
|
|
43
39
|
"eslint-plugin-vue": "^9.3.0",
|