@1stg/eslint-config 5.3.1 → 5.4.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 +11 -0
- package/_util.js +5 -0
- package/base.js +7 -2
- package/overrides.js +10 -15
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 5.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#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
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [[`7228ebb`](https://github.com/1stG/configs/commit/7228ebb1d2a31b5a305258dff24b0d0ca357ad4f)]:
|
|
12
|
+
- @1stg/config@0.2.0
|
|
13
|
+
|
|
3
14
|
## 5.3.1
|
|
4
15
|
|
|
5
16
|
### 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: {
|
|
@@ -438,7 +433,7 @@ exports.markup = [
|
|
|
438
433
|
extends: 'plugin:markup/recommended',
|
|
439
434
|
rules: {
|
|
440
435
|
'prettier/prettier': [
|
|
441
|
-
2,
|
|
436
|
+
preferPrettier ? 0 : 2,
|
|
442
437
|
{
|
|
443
438
|
parser: 'html',
|
|
444
439
|
},
|
|
@@ -447,7 +442,7 @@ exports.markup = [
|
|
|
447
442
|
},
|
|
448
443
|
{
|
|
449
444
|
files: '*.pug',
|
|
450
|
-
extends: ['plugin:markup/recommended',
|
|
445
|
+
extends: ['plugin:markup/recommended', ...prettierExtends],
|
|
451
446
|
},
|
|
452
447
|
]
|
|
453
448
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@1stg/eslint-config",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.4.0",
|
|
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,10 +45,10 @@
|
|
|
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",
|
|
@@ -60,14 +60,14 @@
|
|
|
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.0",
|
|
71
71
|
"eslint-plugin-jsonc": "^2.3.1",
|
|
72
72
|
"eslint-plugin-markup": "^0.10.0",
|
|
73
73
|
"eslint-plugin-mdx": "^2.0.1",
|