eslint-config-uphold 6.12.0 → 6.13.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/README.md +18 -0
- package/package.json +9 -11
- package/src/configs/typescript.js +1 -0
- package/src/index.js +8 -29
package/README.md
CHANGED
|
@@ -303,6 +303,20 @@ import { jest, mocha, vitest } from 'eslint-config-uphold/configs';
|
|
|
303
303
|
> [!NOTE]
|
|
304
304
|
> Test configs use top-level `await` for dynamic module detection and are **ESM-only**. If your project uses CommonJS, your `eslint.config.mjs` still supports `import()` and top-level `await`.
|
|
305
305
|
|
|
306
|
+
### Custom parsers
|
|
307
|
+
|
|
308
|
+
From [ESLint's docs > Configure a Parser](https://eslint.org/docs/latest/use/configure/parser):
|
|
309
|
+
|
|
310
|
+
> You can use custom parsers to convert JavaScript code into an abstract syntax tree for ESLint to evaluate. You might want to add a custom parser if your code isn’t compatible with ESLint’s default parser, Espree.
|
|
311
|
+
>
|
|
312
|
+
> (...)
|
|
313
|
+
>
|
|
314
|
+
> The following third-party parsers are known to be compatible with ESLint:
|
|
315
|
+
>
|
|
316
|
+
> - [Esprima](https://www.npmjs.com/package/esprima)
|
|
317
|
+
> - [@babel/eslint-parser](https://www.npmjs.com/package/@babel/eslint-parser) - A wrapper around the Babel parser that makes it compatible with ESLint.
|
|
318
|
+
> - [@typescript-eslint/parser](https://www.npmjs.com/package/@typescript-eslint/parser) - A parser that converts TypeScript into an ESTree-compatible form so it can be used in ESLint.
|
|
319
|
+
|
|
306
320
|
## Upgrading ESLint
|
|
307
321
|
|
|
308
322
|
See the [ESLint repo](https://github.com/eslint/eslint#semantic-versioning-policy) for ESLint's guidelines on semantic versioning.
|
|
@@ -314,6 +328,10 @@ This is down to the fact that no guarantee is made that minor upgrades do not ca
|
|
|
314
328
|
The downside here is a package update is required for any security or other bug fixes.
|
|
315
329
|
The benefit however is the included rules are always guaranteed to be stable.
|
|
316
330
|
|
|
331
|
+
## Migration guide
|
|
332
|
+
|
|
333
|
+
See the [MIGRATIONS.md](MIGRATIONS.md) file for migration guides between versions v5 and v6, v6 and v7.
|
|
334
|
+
|
|
317
335
|
## Release process
|
|
318
336
|
|
|
319
337
|
The release of a version is automated via the [release](https://github.com/uphold/eslint-config-uphold/.github/workflows/release.yml) GitHub workflow.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-config-uphold",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.13.0",
|
|
4
4
|
"description": "Uphold-flavored ESLint config",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"config",
|
|
@@ -35,13 +35,10 @@
|
|
|
35
35
|
"test": "node --test $(find test -name '*.test.js')"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@
|
|
39
|
-
"@babel/eslint-parser": "^7.28.6",
|
|
40
|
-
"@stylistic/eslint-plugin": "^5.7.0",
|
|
38
|
+
"@stylistic/eslint-plugin": "^5.7.1",
|
|
41
39
|
"dayjs": "^1.11.19",
|
|
42
40
|
"eslint-config-prettier": "^10.1.8",
|
|
43
|
-
"eslint-plugin-jsdoc": "^62.
|
|
44
|
-
"eslint-plugin-mocha": "^11.2.0",
|
|
41
|
+
"eslint-plugin-jsdoc": "^62.5.1",
|
|
45
42
|
"eslint-plugin-n": "^17.23.2",
|
|
46
43
|
"eslint-plugin-prettier": "^5.5.5",
|
|
47
44
|
"eslint-plugin-promise": "^7.2.1",
|
|
@@ -49,17 +46,18 @@
|
|
|
49
46
|
"eslint-plugin-sort-imports-requires": "^2.0.0",
|
|
50
47
|
"eslint-plugin-sort-keys-fix": "^1.1.2",
|
|
51
48
|
"eslint-plugin-sql-template": "^3.1.0",
|
|
52
|
-
"globals": "^17.
|
|
49
|
+
"globals": "^17.3.0"
|
|
53
50
|
},
|
|
54
51
|
"devDependencies": {
|
|
55
52
|
"@fastify/pre-commit": "^2.2.1",
|
|
56
|
-
"@types/node": "^22.19.
|
|
53
|
+
"@types/node": "^22.19.8",
|
|
57
54
|
"@uphold/github-changelog-generator": "^4.0.2",
|
|
58
55
|
"@vitest/eslint-plugin": "^1.6.6",
|
|
59
56
|
"eslint": "~9.39.2",
|
|
60
|
-
"eslint-plugin-jest": "^29.12.
|
|
61
|
-
"
|
|
62
|
-
"
|
|
57
|
+
"eslint-plugin-jest": "^29.12.2",
|
|
58
|
+
"eslint-plugin-mocha": "^11.2.0",
|
|
59
|
+
"prettier": "^3.8.1",
|
|
60
|
+
"release-it": "^19.2.4",
|
|
63
61
|
"typescript": "^5.9.3",
|
|
64
62
|
"typescript-eslint": "^8.54.0"
|
|
65
63
|
},
|
|
@@ -138,6 +138,7 @@ export async function createTypeScriptConfig(moduleType = 'module', { ecmaVersio
|
|
|
138
138
|
},
|
|
139
139
|
rules: {
|
|
140
140
|
...eslintRules,
|
|
141
|
+
'@typescript-eslint/array-type': ['error', { default: 'array-simple', readonly: 'array-simple' }],
|
|
141
142
|
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_', varsIgnorePattern: '^_.+' }],
|
|
142
143
|
'no-unused-expressions': 'off',
|
|
143
144
|
'no-unused-vars': 'off'
|
package/src/index.js
CHANGED
|
@@ -6,6 +6,7 @@ import { defineConfig } from 'eslint/config';
|
|
|
6
6
|
import {
|
|
7
7
|
eslintRules,
|
|
8
8
|
jsdocPluginConfigJavaScript,
|
|
9
|
+
nodePluginConfig,
|
|
9
10
|
promisePluginConfig,
|
|
10
11
|
sortDestructureKeysConfig,
|
|
11
12
|
sortImportsRequiresConfig,
|
|
@@ -13,7 +14,6 @@ import {
|
|
|
13
14
|
sqlTemplateConfig,
|
|
14
15
|
stylisticConfig
|
|
15
16
|
} from './configs/common.js';
|
|
16
|
-
import babelParser from '@babel/eslint-parser';
|
|
17
17
|
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
|
|
18
18
|
import globals from 'globals';
|
|
19
19
|
import js from '@eslint/js';
|
|
@@ -35,17 +35,8 @@ import stylistic from '@stylistic/eslint-plugin';
|
|
|
35
35
|
*/
|
|
36
36
|
|
|
37
37
|
const languageOptions = {
|
|
38
|
-
ecmaVersion:
|
|
39
|
-
globals:
|
|
40
|
-
...globals.jasmine,
|
|
41
|
-
...globals.jest,
|
|
42
|
-
...globals.mocha,
|
|
43
|
-
...globals.node
|
|
44
|
-
},
|
|
45
|
-
parser: babelParser,
|
|
46
|
-
parserOptions: {
|
|
47
|
-
requireConfigFile: false
|
|
48
|
-
},
|
|
38
|
+
ecmaVersion: 2022,
|
|
39
|
+
globals: globals.node,
|
|
49
40
|
sourceType: 'module'
|
|
50
41
|
};
|
|
51
42
|
|
|
@@ -68,8 +59,8 @@ const upholdBaseConfig = defineConfig([
|
|
|
68
59
|
'@stylistic': stylistic,
|
|
69
60
|
jsdoc,
|
|
70
61
|
mocha,
|
|
71
|
-
//
|
|
72
|
-
|
|
62
|
+
// eslint-disable-next-line id-length
|
|
63
|
+
n: nodePlugin,
|
|
73
64
|
// @ts-expect-error Outdated types for `eslint-plugin-promise`.
|
|
74
65
|
promise,
|
|
75
66
|
// @ts-expect-error Outdated types for `eslint-plugin-sort-destructure-keys`.
|
|
@@ -82,25 +73,13 @@ const upholdBaseConfig = defineConfig([
|
|
|
82
73
|
},
|
|
83
74
|
rules: {
|
|
84
75
|
...eslintRules,
|
|
76
|
+
...nodePluginConfig.rules,
|
|
85
77
|
...promisePluginConfig.rules,
|
|
86
78
|
...sortDestructureKeysConfig.rules,
|
|
87
79
|
...sortImportsRequiresConfig.rules,
|
|
88
80
|
...sortKeysFixConfig.rules,
|
|
89
81
|
...sqlTemplateConfig.rules,
|
|
90
82
|
...stylisticConfig.rules,
|
|
91
|
-
// Mocha rules to be removed on next major release.
|
|
92
|
-
'mocha/no-exclusive-tests': 'error',
|
|
93
|
-
'mocha/no-identical-title': 'error',
|
|
94
|
-
'mocha/no-nested-tests': 'error',
|
|
95
|
-
'mocha/no-sibling-hooks': 'error',
|
|
96
|
-
'node-plugin/no-mixed-requires': 'error',
|
|
97
|
-
'node-plugin/no-new-require': 'error',
|
|
98
|
-
'node-plugin/no-path-concat': 'error',
|
|
99
|
-
'node-plugin/no-process-env': 'error',
|
|
100
|
-
'node-plugin/no-process-exit': 'error',
|
|
101
|
-
'node-plugin/no-restricted-import': 'error',
|
|
102
|
-
'node-plugin/no-restricted-require': 'error',
|
|
103
|
-
'node-plugin/no-sync': 'error',
|
|
104
83
|
'uphold-plugin/explicit-sinon-use-fake-timers': 'error',
|
|
105
84
|
'uphold-plugin/no-trailing-period-in-log-messages': 'error',
|
|
106
85
|
'uphold-plugin/require-comment-punctuation': 'error'
|
|
@@ -119,8 +98,8 @@ const upholdBinScriptsConfig = {
|
|
|
119
98
|
languageOptions,
|
|
120
99
|
name: 'uphold/scripts',
|
|
121
100
|
rules: {
|
|
122
|
-
'no-
|
|
123
|
-
'
|
|
101
|
+
'n/no-process-exit': 'off',
|
|
102
|
+
'no-console': 'off'
|
|
124
103
|
}
|
|
125
104
|
};
|
|
126
105
|
|