@1stg/eslint-config 5.3.1 → 5.4.2
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 +23 -0
- package/_util.js +5 -0
- package/base.js +7 -2
- package/overrides.js +22 -15
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 5.4.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#133](https://github.com/1stG/configs/pull/133) [`9db70a5`](https://github.com/1stG/configs/commit/9db70a5dd136fbd6536b099863b5f617e4ffc29a) Thanks [@JounQin](https://github.com/JounQin)! - fix(eslint): incorrect prettier parser inferred for angular html files
|
|
8
|
+
|
|
9
|
+
## 5.4.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#131](https://github.com/1stG/configs/pull/131) [`1e06825`](https://github.com/1stG/configs/commit/1e068259c54b12751960dbdc8acaa07949134f0f) Thanks [@JounQin](https://github.com/JounQin)! - fix(eslint): disable prettier/prettier rule for md/mdx automatically
|
|
14
|
+
|
|
15
|
+
## 5.4.0
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- [#128](https://github.com/1stG/configs/pull/128) [`7228ebb`](https://github.com/1stG/configs/commit/7228ebb1d2a31b5a305258dff24b0d0ca357ad4f) Thanks [@JounQin](https://github.com/JounQin)! - feat: support `CONFIG_PREFER_PRETTIER` env
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- Updated dependencies [[`7228ebb`](https://github.com/1stG/configs/commit/7228ebb1d2a31b5a305258dff24b0d0ca357ad4f)]:
|
|
24
|
+
- @1stg/config@0.2.0
|
|
25
|
+
|
|
3
26
|
## 5.3.1
|
|
4
27
|
|
|
5
28
|
### Patch Changes
|
package/_util.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const path = require('node:path')
|
|
2
2
|
|
|
3
|
+
const { preferPrettier } = require('@1stg/config')
|
|
3
4
|
const {
|
|
4
5
|
isMonorepo,
|
|
5
6
|
isPkgAvailable,
|
|
@@ -43,3 +44,7 @@ exports.magicNumbers = [
|
|
|
43
44
|
-1, 0, 1, 2, 3, 5, 7, 10, 12, 15, 20, 24, 30, 31, 50, 60, 100, 365, 366, 500,
|
|
44
45
|
768, 1000, 1024, 3600, 4200, 8080,
|
|
45
46
|
]
|
|
47
|
+
|
|
48
|
+
exports.prettierExtends = preferPrettier
|
|
49
|
+
? ['prettier']
|
|
50
|
+
: ['plugin:prettier/recommended']
|
package/base.js
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
const { isTsAvailable } = require('@pkgr/utils')
|
|
2
2
|
const { getGlobals } = require('eslint-plugin-mdx')
|
|
3
3
|
|
|
4
|
-
const {
|
|
4
|
+
const {
|
|
5
|
+
isWebpackAvailable,
|
|
6
|
+
magicNumbers,
|
|
7
|
+
webpackSpecVars,
|
|
8
|
+
prettierExtends,
|
|
9
|
+
} = require('./_util')
|
|
5
10
|
|
|
6
11
|
module.exports = {
|
|
7
12
|
extends: [
|
|
@@ -16,7 +21,7 @@ module.exports = {
|
|
|
16
21
|
isTsAvailable && 'plugin:sonar/recommended',
|
|
17
22
|
'plugin:unicorn/recommended',
|
|
18
23
|
'standard',
|
|
19
|
-
|
|
24
|
+
...prettierExtends,
|
|
20
25
|
].filter(Boolean),
|
|
21
26
|
plugins: ['es-x', 'simple-import-sort'],
|
|
22
27
|
globals: isWebpackAvailable ? getGlobals(webpackSpecVars) : undefined,
|
package/overrides.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const path = require('node:path')
|
|
2
2
|
|
|
3
|
-
const { jsoncFiles, nonJsonRcFiles } = require('@1stg/config')
|
|
3
|
+
const { jsoncFiles, nonJsonRcFiles, preferPrettier } = require('@1stg/config')
|
|
4
4
|
const {
|
|
5
5
|
isAngularAvailable,
|
|
6
6
|
isReactAvailable,
|
|
@@ -12,7 +12,7 @@ const {
|
|
|
12
12
|
tryPkg,
|
|
13
13
|
} = require('@pkgr/utils')
|
|
14
14
|
|
|
15
|
-
const { magicNumbers } = require('./_util')
|
|
15
|
+
const { magicNumbers, prettierExtends } = require('./_util')
|
|
16
16
|
|
|
17
17
|
const configFile =
|
|
18
18
|
tryFile(path.resolve('babel.config.js')) ||
|
|
@@ -92,8 +92,7 @@ const tsBase = {
|
|
|
92
92
|
'plugin:@typescript-eslint/eslint-recommended',
|
|
93
93
|
'plugin:@typescript-eslint/recommended',
|
|
94
94
|
'plugin:import/typescript',
|
|
95
|
-
|
|
96
|
-
'plugin:prettier/recommended',
|
|
95
|
+
...prettierExtends,
|
|
97
96
|
],
|
|
98
97
|
settings: resolveSettings,
|
|
99
98
|
rules: {
|
|
@@ -271,11 +270,7 @@ exports.dTs = {
|
|
|
271
270
|
}
|
|
272
271
|
|
|
273
272
|
const reactJsx = {
|
|
274
|
-
extends: [
|
|
275
|
-
'standard-react',
|
|
276
|
-
'plugin:react/recommended',
|
|
277
|
-
'plugin:prettier/recommended',
|
|
278
|
-
],
|
|
273
|
+
extends: ['standard-react', 'plugin:react/recommended', ...prettierExtends],
|
|
279
274
|
settings: {
|
|
280
275
|
react: {
|
|
281
276
|
version: 'detect',
|
|
@@ -326,7 +321,7 @@ exports.reactTs = {
|
|
|
326
321
|
},
|
|
327
322
|
}
|
|
328
323
|
|
|
329
|
-
const vueExtends = ['plugin:vue/recommended',
|
|
324
|
+
const vueExtends = ['plugin:vue/recommended', ...prettierExtends]
|
|
330
325
|
|
|
331
326
|
exports.vue = [
|
|
332
327
|
{
|
|
@@ -369,7 +364,7 @@ const svelteBase = {
|
|
|
369
364
|
'plugin:markup/recommended',
|
|
370
365
|
'plugin:svelte/recommended',
|
|
371
366
|
'plugin:svelte/prettier',
|
|
372
|
-
|
|
367
|
+
...prettierExtends,
|
|
373
368
|
],
|
|
374
369
|
rules: {
|
|
375
370
|
'sonar/label-position': 0,
|
|
@@ -400,7 +395,7 @@ exports.angular = [
|
|
|
400
395
|
extends: [
|
|
401
396
|
'plugin:@angular-eslint/recommended',
|
|
402
397
|
'plugin:@angular-eslint/template/process-inline-templates',
|
|
403
|
-
|
|
398
|
+
...prettierExtends,
|
|
404
399
|
],
|
|
405
400
|
rules: {
|
|
406
401
|
'@angular-eslint/prefer-on-push-component-change-detection': 1,
|
|
@@ -411,7 +406,7 @@ exports.angular = [
|
|
|
411
406
|
extends: [
|
|
412
407
|
'plugin:@angular-eslint/template/recommended',
|
|
413
408
|
'plugin:markup/recommended',
|
|
414
|
-
|
|
409
|
+
...prettierExtends,
|
|
415
410
|
],
|
|
416
411
|
parser: 'angular-eslint-template-parser',
|
|
417
412
|
rules: {
|
|
@@ -421,6 +416,12 @@ exports.angular = [
|
|
|
421
416
|
allowNullOrUndefined: true,
|
|
422
417
|
},
|
|
423
418
|
],
|
|
419
|
+
'prettier/prettier': [
|
|
420
|
+
preferPrettier ? 0 : 2,
|
|
421
|
+
{
|
|
422
|
+
parser: 'angular',
|
|
423
|
+
},
|
|
424
|
+
],
|
|
424
425
|
'spaced-comment': 0,
|
|
425
426
|
},
|
|
426
427
|
},
|
|
@@ -438,7 +439,7 @@ exports.markup = [
|
|
|
438
439
|
extends: 'plugin:markup/recommended',
|
|
439
440
|
rules: {
|
|
440
441
|
'prettier/prettier': [
|
|
441
|
-
2,
|
|
442
|
+
preferPrettier ? 0 : 2,
|
|
442
443
|
{
|
|
443
444
|
parser: 'html',
|
|
444
445
|
},
|
|
@@ -447,13 +448,16 @@ exports.markup = [
|
|
|
447
448
|
},
|
|
448
449
|
{
|
|
449
450
|
files: '*.pug',
|
|
450
|
-
extends: ['plugin:markup/recommended',
|
|
451
|
+
extends: ['plugin:markup/recommended', ...prettierExtends],
|
|
451
452
|
},
|
|
452
453
|
]
|
|
453
454
|
|
|
454
455
|
exports.md = {
|
|
455
456
|
files: '*.md',
|
|
456
457
|
extends: ['plugin:mdx/recommended'],
|
|
458
|
+
rules: {
|
|
459
|
+
'prettier/prettier': preferPrettier ? 0 : 2,
|
|
460
|
+
},
|
|
457
461
|
}
|
|
458
462
|
|
|
459
463
|
exports.mdx = {
|
|
@@ -461,6 +465,9 @@ exports.mdx = {
|
|
|
461
465
|
extends: [...reactJsx.extends, 'plugin:mdx/recommended'],
|
|
462
466
|
parserOptions: jsBase.parserOptions,
|
|
463
467
|
settings: { ...reactJsx.settings, ...resolveSettings },
|
|
468
|
+
rules: {
|
|
469
|
+
'prettier/prettier': preferPrettier ? 0 : 2,
|
|
470
|
+
},
|
|
464
471
|
}
|
|
465
472
|
|
|
466
473
|
const nonSourceRules = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@1stg/eslint-config",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.4.2",
|
|
4
4
|
"description": "Personal but Shareable ESLint Configuration for all 1stG.me projects",
|
|
5
5
|
"repository": "git+https://github.com/1stG/configs.git",
|
|
6
6
|
"homepage": "https://github.com/1stG/configs/tree/master/packages/eslint-config",
|
|
@@ -45,29 +45,29 @@
|
|
|
45
45
|
"eslint": ">=6.0.0"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@1stg/config": "^0.
|
|
49
|
-
"@angular-eslint/eslint-plugin": "^14.0.
|
|
50
|
-
"@angular-eslint/eslint-plugin-template": "^14.0.
|
|
51
|
-
"@angular-eslint/template-parser": "^14.0.
|
|
48
|
+
"@1stg/config": "^0.2.0",
|
|
49
|
+
"@angular-eslint/eslint-plugin": "^14.0.2",
|
|
50
|
+
"@angular-eslint/eslint-plugin-template": "^14.0.2",
|
|
51
|
+
"@angular-eslint/template-parser": "^14.0.2",
|
|
52
52
|
"@babel/eslint-parser": "^7.18.2",
|
|
53
53
|
"@babel/eslint-plugin": "^7.17.7",
|
|
54
54
|
"@pkgr/utils": "^2.3.0",
|
|
55
|
-
"@typescript-eslint/eslint-plugin": "^5.30.
|
|
56
|
-
"@typescript-eslint/parser": "^5.30.
|
|
55
|
+
"@typescript-eslint/eslint-plugin": "^5.30.6",
|
|
56
|
+
"@typescript-eslint/parser": "^5.30.6",
|
|
57
57
|
"angular-eslint-template-parser": "^0.1.1",
|
|
58
58
|
"eslint-config-prettier": "^8.5.0",
|
|
59
59
|
"eslint-config-standard": "^17.0.0",
|
|
60
60
|
"eslint-config-standard-jsx": "^11.0.0",
|
|
61
61
|
"eslint-config-standard-react": "^11.0.1",
|
|
62
62
|
"eslint-formatter-friendly": "^7.0.0",
|
|
63
|
-
"eslint-import-resolver-typescript": "^3.2.
|
|
63
|
+
"eslint-import-resolver-typescript": "^3.2.5",
|
|
64
64
|
"eslint-plugin-css": "^0.6.0",
|
|
65
65
|
"eslint-plugin-es-x": "^5.2.1",
|
|
66
66
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
67
67
|
"eslint-plugin-import": "^2.26.0",
|
|
68
68
|
"eslint-plugin-jest": "^26.5.3",
|
|
69
69
|
"eslint-plugin-jsdoc": "^39.3.3",
|
|
70
|
-
"eslint-plugin-json-schema-validator": "^3.
|
|
70
|
+
"eslint-plugin-json-schema-validator": "^3.2.3",
|
|
71
71
|
"eslint-plugin-jsonc": "^2.3.1",
|
|
72
72
|
"eslint-plugin-markup": "^0.10.0",
|
|
73
73
|
"eslint-plugin-mdx": "^2.0.1",
|