@adobe/eslint-config-helix 2.0.8 → 3.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/.github/workflows/main.yaml +3 -3
- package/.releaserc.cjs +16 -0
- package/CHANGELOG.md +19 -0
- package/README.md +20 -1
- package/eslint.config.js +20 -0
- package/index.js +86 -38
- package/package.json +8 -8
- package/rules/best-practices.js +435 -0
- package/rules/errors.js +200 -0
- package/rules/es6.js +199 -0
- package/rules/header.js +102 -0
- package/rules/imports.js +290 -0
- package/rules/node.js +57 -0
- package/rules/strict.js +17 -0
- package/rules/style.js +537 -0
- package/rules/variables.js +68 -0
|
@@ -14,11 +14,11 @@ jobs:
|
|
|
14
14
|
- name: Use Node.js 20.x
|
|
15
15
|
uses: actions/setup-node@v4
|
|
16
16
|
with:
|
|
17
|
-
node-version: '
|
|
17
|
+
node-version: '22.x'
|
|
18
18
|
- run: npm ci
|
|
19
19
|
- run: npm run lint
|
|
20
20
|
- run: npm test
|
|
21
|
-
- uses: codecov/codecov-action@
|
|
21
|
+
- uses: codecov/codecov-action@v5
|
|
22
22
|
with:
|
|
23
23
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
24
24
|
- name: Semantic Release (Dry Run)
|
|
@@ -37,7 +37,7 @@ jobs:
|
|
|
37
37
|
- name: Use Node.js 20.x
|
|
38
38
|
uses: actions/setup-node@v4
|
|
39
39
|
with:
|
|
40
|
-
node-version: '
|
|
40
|
+
node-version: '22.x'
|
|
41
41
|
- run: npm ci
|
|
42
42
|
- run: npm run semantic-release
|
|
43
43
|
env:
|
package/.releaserc.cjs
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
plugins: [
|
|
3
|
+
"@semantic-release/commit-analyzer",
|
|
4
|
+
"@semantic-release/release-notes-generator",
|
|
5
|
+
["@semantic-release/changelog", {
|
|
6
|
+
"changelogFile": "CHANGELOG.md",
|
|
7
|
+
}],
|
|
8
|
+
"@semantic-release/npm",
|
|
9
|
+
["@semantic-release/git", {
|
|
10
|
+
"assets": ["package.json", "package-lock.json", "CHANGELOG.md"],
|
|
11
|
+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
|
|
12
|
+
}],
|
|
13
|
+
["@semantic-release/github", {}]
|
|
14
|
+
],
|
|
15
|
+
branches: ['main'],
|
|
16
|
+
};
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
# [3.0.0](https://github.com/adobe/helix-eslint-config/compare/v2.0.9...v3.0.0) (2025-05-28)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* Create configuration for eslint v9 ([#230](https://github.com/adobe/helix-eslint-config/issues/230)) ([b5153ff](https://github.com/adobe/helix-eslint-config/commit/b5153ffe40024bba9d47fb1f5f433651c718e9b0))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### BREAKING CHANGES
|
|
10
|
+
|
|
11
|
+
* requires eslint v9
|
|
12
|
+
|
|
13
|
+
## [2.0.9](https://github.com/adobe/helix-eslint-config/compare/v2.0.8...v2.0.9) (2025-02-06)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
|
|
18
|
+
* update copyright year ([#224](https://github.com/adobe/helix-eslint-config/issues/224)) ([f66bdf2](https://github.com/adobe/helix-eslint-config/commit/f66bdf20b1bd78f9d4e878e1b8824e727955b86b))
|
|
19
|
+
|
|
1
20
|
## [2.0.8](https://github.com/adobe/helix-eslint-config/compare/v2.0.7...v2.0.8) (2024-10-05)
|
|
2
21
|
|
|
3
22
|
|
package/README.md
CHANGED
|
@@ -2,12 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
Eslint config used in helix projects.
|
|
4
4
|
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
In your `eslint.config.js`, import the `recommended` settings and add your ignores, e.g.:
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
import { defineConfig, globalIgnores } from '@eslint/config-helpers'
|
|
11
|
+
import { recommended } from '@adobe/eslint-config-helix';
|
|
12
|
+
|
|
13
|
+
export default defineConfig([
|
|
14
|
+
globalIgnores([
|
|
15
|
+
'.vscode/*',
|
|
16
|
+
'coverage/*',
|
|
17
|
+
'dist/*',
|
|
18
|
+
]),
|
|
19
|
+
{
|
|
20
|
+
extends: [recommended],
|
|
21
|
+
},
|
|
22
|
+
]);
|
|
23
|
+
```
|
|
5
24
|
|
|
6
25
|
## Status
|
|
7
26
|
|
|
8
27
|
[](https://circleci.com/gh/adobe/helix-eslint-config)
|
|
9
28
|
[](https://github.com/adobe/helix-eslint-config/blob/main/LICENSE.txt)
|
|
10
|
-
[](https://github.com/adobe/helix-eslint-config/issues)
|
|
29
|
+
[](https://github.com/adobe/helix-eslint-config/issues)
|
|
11
30
|
|
|
12
31
|
## Development
|
|
13
32
|
|
package/eslint.config.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2019 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
import { defineConfig } from '@eslint/config-helpers';
|
|
13
|
+
import { base } from './index.js';
|
|
14
|
+
|
|
15
|
+
export default defineConfig(
|
|
16
|
+
{
|
|
17
|
+
files: ['**/*.js'],
|
|
18
|
+
extends: [base],
|
|
19
|
+
},
|
|
20
|
+
);
|
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright
|
|
2
|
+
* Copyright 2025 Adobe. All rights reserved.
|
|
3
3
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
5
|
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
@@ -9,24 +9,47 @@
|
|
|
9
9
|
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
10
|
* governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
12
|
+
import globals from 'globals';
|
|
13
|
+
import { defineConfig } from '@eslint/config-helpers';
|
|
14
|
+
|
|
15
|
+
import bestPractices from './rules/best-practices.js';
|
|
16
|
+
import errors from './rules/errors.js';
|
|
17
|
+
import node from './rules/node.js';
|
|
18
|
+
import style from './rules/style.js';
|
|
19
|
+
import variables from './rules/variables.js';
|
|
20
|
+
import es6 from './rules/es6.js';
|
|
21
|
+
import imports from './rules/imports.js';
|
|
22
|
+
import strict from './rules/strict.js';
|
|
23
|
+
|
|
24
|
+
import header from './rules/header.js';
|
|
25
|
+
|
|
26
|
+
const base = {
|
|
27
|
+
languageOptions: {
|
|
23
28
|
ecmaVersion: 2022,
|
|
29
|
+
sourceType: 'module',
|
|
30
|
+
globals: {
|
|
31
|
+
...globals.node,
|
|
32
|
+
...globals.es6,
|
|
33
|
+
__rootdir: true,
|
|
34
|
+
},
|
|
35
|
+
parserOptions: {
|
|
36
|
+
...es6.languageOptions.parserOptions,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
plugins: {
|
|
40
|
+
header,
|
|
41
|
+
...imports.plugins,
|
|
24
42
|
},
|
|
25
|
-
plugins: [
|
|
26
|
-
'header',
|
|
27
|
-
'import',
|
|
28
|
-
],
|
|
29
43
|
rules: {
|
|
44
|
+
...bestPractices.rules,
|
|
45
|
+
...errors.rules,
|
|
46
|
+
...node.rules,
|
|
47
|
+
...style.rules,
|
|
48
|
+
...variables.rules,
|
|
49
|
+
...es6.rules,
|
|
50
|
+
...imports.rules,
|
|
51
|
+
...strict.rules,
|
|
52
|
+
|
|
30
53
|
strict: 0,
|
|
31
54
|
|
|
32
55
|
'import/prefer-default-export': 0,
|
|
@@ -56,6 +79,7 @@ module.exports = {
|
|
|
56
79
|
'no-unused-vars': ['error', {
|
|
57
80
|
argsIgnorePattern: '^_$',
|
|
58
81
|
varsIgnorePattern: '^_$',
|
|
82
|
+
caughtErrors: 'none',
|
|
59
83
|
}],
|
|
60
84
|
|
|
61
85
|
'no-shadow': ['error', {
|
|
@@ -63,36 +87,60 @@ module.exports = {
|
|
|
63
87
|
}],
|
|
64
88
|
|
|
65
89
|
// don't enforce extension rules
|
|
66
|
-
'import/extensions': [
|
|
90
|
+
'import/extensions': ['error', 'ignorePackages'],
|
|
67
91
|
|
|
68
92
|
// enforce license header
|
|
69
|
-
'header/header': [
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
93
|
+
'header/header': ['error', {
|
|
94
|
+
block: [
|
|
95
|
+
'',
|
|
96
|
+
{ pattern: ' * Copyright \\d{4} Adobe\\. All rights reserved\\.' },
|
|
97
|
+
' * This file is licensed to you under the Apache License, Version 2.0 (the "License");',
|
|
98
|
+
' * you may not use this file except in compliance with the License. You may obtain a copy',
|
|
99
|
+
' * of the License at http://www.apache.org/licenses/LICENSE-2.0',
|
|
100
|
+
' *',
|
|
101
|
+
' * Unless required by applicable law or agreed to in writing, software distributed under',
|
|
102
|
+
' * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS',
|
|
103
|
+
' * OF ANY KIND, either express or implied. See the License for the specific language',
|
|
104
|
+
' * governing permissions and limitations under the License.',
|
|
105
|
+
' ',
|
|
106
|
+
],
|
|
107
|
+
}],
|
|
81
108
|
|
|
82
109
|
'id-match': ['error', '^(?!.*?([wW][hH][iI][tT][eE]|[bB][lL][aA][cC][kK]).*[lL][iI][sS][tT]).*$', {
|
|
83
110
|
properties: true,
|
|
84
111
|
}],
|
|
85
112
|
},
|
|
86
113
|
settings: {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
'
|
|
91
|
-
exports: {},
|
|
92
|
-
},
|
|
114
|
+
...imports.settings,
|
|
115
|
+
},
|
|
116
|
+
linterOptions: {
|
|
117
|
+
reportUnusedDisableDirectives: 'off',
|
|
93
118
|
},
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
const source = {
|
|
122
|
+
...base,
|
|
123
|
+
files: ['src/**/*.js', 'test/dev/*.mjs'],
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
const test = {
|
|
127
|
+
...base,
|
|
128
|
+
files: ['test/**/*.js'],
|
|
129
|
+
languageOptions: {
|
|
130
|
+
...base.languageOptions,
|
|
131
|
+
globals: {
|
|
132
|
+
...base.languageOptions.globals,
|
|
133
|
+
...globals.mocha,
|
|
134
|
+
__testdir: true,
|
|
135
|
+
},
|
|
97
136
|
},
|
|
98
137
|
};
|
|
138
|
+
|
|
139
|
+
const recommended = defineConfig([
|
|
140
|
+
source,
|
|
141
|
+
test,
|
|
142
|
+
]);
|
|
143
|
+
|
|
144
|
+
export {
|
|
145
|
+
base, source, test, recommended,
|
|
146
|
+
};
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/eslint-config-helix",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Helix's ESLint config, based on Airbnb's style guide",
|
|
5
5
|
"main": "index.js",
|
|
6
|
+
"type": "module",
|
|
6
7
|
"scripts": {
|
|
7
8
|
"lint": "./node_modules/.bin/eslint .",
|
|
8
9
|
"semantic-release-dry": "semantic-release --dry-run --branches $CI_BRANCH",
|
|
@@ -25,19 +26,18 @@
|
|
|
25
26
|
},
|
|
26
27
|
"homepage": "https://github.com/adobe/helix-eslint-config#readme",
|
|
27
28
|
"dependencies": {
|
|
28
|
-
"eslint
|
|
29
|
-
"eslint-import
|
|
30
|
-
"
|
|
31
|
-
"eslint-plugin-import": "2.31.0"
|
|
29
|
+
"@eslint/config-helpers": "0.2.2",
|
|
30
|
+
"eslint-plugin-import": "2.31.0",
|
|
31
|
+
"globals": "15.3.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@semantic-release/changelog": "6.0.3",
|
|
35
35
|
"@semantic-release/git": "10.0.1",
|
|
36
|
-
"eslint": "
|
|
37
|
-
"semantic-release": "24.
|
|
36
|
+
"eslint": "9.4.0",
|
|
37
|
+
"semantic-release": "24.2.5"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"eslint": "^
|
|
40
|
+
"eslint": "^9.0.0"
|
|
41
41
|
},
|
|
42
42
|
"engines": {
|
|
43
43
|
"node": ">= 12"
|