@1stg/eslint-config 5.2.5 → 5.3.1

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 CHANGED
@@ -1,5 +1,32 @@
1
1
  # Change Log
2
2
 
3
+ ## 5.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#126](https://github.com/1stG/configs/pull/126) [`48d7542`](https://github.com/1stG/configs/commit/48d754293d6d68094792df71d56e8d7e8fc088a8) Thanks [@JounQin](https://github.com/JounQin)! - fix: support more `markup` files
8
+
9
+ ## 5.3.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#121](https://github.com/1stG/configs/pull/121) [`e23439a`](https://github.com/1stG/configs/commit/e23439a4691c6a49f6413ccfcda281c5f77dc85c) Thanks [@JounQin](https://github.com/JounQin)! - feat: add @1stg/config for sharing configs
14
+
15
+ ### Patch Changes
16
+
17
+ - [#121](https://github.com/1stG/configs/pull/121) [`e23439a`](https://github.com/1stG/configs/commit/e23439a4691c6a49f6413ccfcda281c5f77dc85c) Thanks [@JounQin](https://github.com/JounQin)! - fix(prettier): .vscode/\*.json should be considered as jsonc
18
+
19
+ - [#123](https://github.com/1stG/configs/pull/123) [`4f70fd3`](https://github.com/1stG/configs/commit/4f70fd3aeff6b1b66ccb607fcb61f59977d773c1) Thanks [@JounQin](https://github.com/JounQin)! - docs: add README files
20
+
21
+ - Updated dependencies [[`8aa8066`](https://github.com/1stG/configs/commit/8aa8066a926a3fd972a051bbbce11fab4cd35896), [`4f70fd3`](https://github.com/1stG/configs/commit/4f70fd3aeff6b1b66ccb607fcb61f59977d773c1), [`e23439a`](https://github.com/1stG/configs/commit/e23439a4691c6a49f6413ccfcda281c5f77dc85c)]:
22
+ - @1stg/config@0.1.0
23
+
24
+ ## 5.2.6
25
+
26
+ ### Patch Changes
27
+
28
+ - [#117](https://github.com/1stG/configs/pull/117) [`5b9ae0a`](https://github.com/1stG/configs/commit/5b9ae0aa2df2fabf119bc79c1d735be1894830c7) Thanks [@JounQin](https://github.com/JounQin)! - chore: upgrade @pkgr/utils
29
+
3
30
  ## 5.2.5
4
31
 
5
32
  ### Patch Changes
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2019 1stG
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,27 @@
1
+ # @1stg/eslint-config
2
+
3
+ Personal but Shareable ESLint Configuration for all 1stG.me projects
4
+
5
+ ## Sponsors
6
+
7
+ | 1stG | RxTS | UnTS |
8
+ | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
9
+ | [![1stG Open Collective backers and sponsors](https://opencollective.com/1stG/organizations.svg)](https://opencollective.com/1stG) | [![RxTS Open Collective backers and sponsors](https://opencollective.com/rxts/organizations.svg)](https://opencollective.com/rxts) | [![UnTS Open Collective backers and sponsors](https://opencollective.com/unts/organizations.svg)](https://opencollective.com/unts) |
10
+
11
+ ## Backers
12
+
13
+ | 1stG | RxTS | UnTS |
14
+ | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
15
+ | [![1stG Open Collective backers and sponsors](https://opencollective.com/1stG/individuals.svg)](https://opencollective.com/1stG) | [![RxTS Open Collective backers and sponsors](https://opencollective.com/rxts/individuals.svg)](https://opencollective.com/rxts) | [![UnTS Open Collective backers and sponsors](https://opencollective.com/unts/individuals.svg)](https://opencollective.com/unts) |
16
+
17
+ ## Changelog
18
+
19
+ Detailed changes for each release are documented in [CHANGELOG.md](./CHANGELOG.md).
20
+
21
+ ## License
22
+
23
+ [MIT][] © [JounQin][]@[1stG.me][]
24
+
25
+ [1stg.me]: https://www.1stg.me
26
+ [jounqin]: https://GitHub.com/JounQin
27
+ [mit]: http://opensource.org/licenses/MIT
package/overrides.js CHANGED
@@ -1,5 +1,6 @@
1
1
  const path = require('node:path')
2
2
 
3
+ const { jsoncFiles, nonJsonRcFiles } = require('@1stg/config')
3
4
  const {
4
5
  isAngularAvailable,
5
6
  isReactAvailable,
@@ -68,7 +69,6 @@ exports.js = {
68
69
  const project =
69
70
  tryFile(path.resolve('tsconfig.eslint.json')) ||
70
71
  tryFile(path.resolve('tsconfig.base.json')) ||
71
- // eslint-disable-next-line sonarjs/no-duplicate-string
72
72
  tryFile(path.resolve('tsconfig.json')) ||
73
73
  tryPkg('@1stg/tsconfig')
74
74
 
@@ -92,7 +92,8 @@ const tsBase = {
92
92
  'plugin:@typescript-eslint/eslint-recommended',
93
93
  'plugin:@typescript-eslint/recommended',
94
94
  'plugin:import/typescript',
95
- 'prettier',
95
+ // eslint-disable-next-line sonarjs/no-duplicate-string
96
+ 'plugin:prettier/recommended',
96
97
  ],
97
98
  settings: resolveSettings,
98
99
  rules: {
@@ -270,7 +271,11 @@ exports.dTs = {
270
271
  }
271
272
 
272
273
  const reactJsx = {
273
- extends: ['standard-react', 'plugin:react/recommended', 'prettier'],
274
+ extends: [
275
+ 'standard-react',
276
+ 'plugin:react/recommended',
277
+ 'plugin:prettier/recommended',
278
+ ],
274
279
  settings: {
275
280
  react: {
276
281
  version: 'detect',
@@ -321,7 +326,7 @@ exports.reactTs = {
321
326
  },
322
327
  }
323
328
 
324
- const vueExtends = ['plugin:vue/recommended', 'prettier']
329
+ const vueExtends = ['plugin:vue/recommended', 'plugin:prettier/recommended']
325
330
 
326
331
  exports.vue = [
327
332
  {
@@ -346,6 +351,11 @@ exports.vue = [
346
351
  },
347
352
  {
348
353
  files: '*.vue',
354
+ extends: [
355
+ // eslint-disable-next-line sonarjs/no-duplicate-string
356
+ 'plugin:markup/recommended',
357
+ ...vueExtends,
358
+ ],
349
359
  rules: {
350
360
  'no-unused-vars': 0,
351
361
  '@typescript-eslint/no-unused-vars': 0,
@@ -355,7 +365,12 @@ exports.vue = [
355
365
 
356
366
  const svelteBase = {
357
367
  files: '*.svelte',
358
- extends: ['plugin:svelte/recommended'],
368
+ extends: [
369
+ 'plugin:markup/recommended',
370
+ 'plugin:svelte/recommended',
371
+ 'plugin:svelte/prettier',
372
+ 'plugin:prettier/recommended',
373
+ ],
359
374
  rules: {
360
375
  'sonar/label-position': 0,
361
376
  'sonar/no-labels': 0,
@@ -385,7 +400,7 @@ exports.angular = [
385
400
  extends: [
386
401
  'plugin:@angular-eslint/recommended',
387
402
  'plugin:@angular-eslint/template/process-inline-templates',
388
- 'prettier',
403
+ 'plugin:prettier/recommended',
389
404
  ],
390
405
  rules: {
391
406
  '@angular-eslint/prefer-on-push-component-change-detection': 1,
@@ -396,6 +411,7 @@ exports.angular = [
396
411
  extends: [
397
412
  'plugin:@angular-eslint/template/recommended',
398
413
  'plugin:markup/recommended',
414
+ 'plugin:prettier/recommended',
399
415
  ],
400
416
  parser: 'angular-eslint-template-parser',
401
417
  rules: {
@@ -405,44 +421,36 @@ exports.angular = [
405
421
  allowNullOrUndefined: true,
406
422
  },
407
423
  ],
408
- 'prettier/prettier': 0,
409
424
  'spaced-comment': 0,
410
425
  },
411
426
  },
427
+ {
428
+ files: '*inline-template-*.component.html',
429
+ rules: {
430
+ 'unicorn/no-empty-file': 0,
431
+ },
432
+ },
433
+ ]
434
+
435
+ exports.markup = [
412
436
  {
413
437
  files: '*.html',
414
- excludedFiles: '*inline-template-*.component.html',
415
- extends: ['prettier'],
438
+ extends: 'plugin:markup/recommended',
416
439
  rules: {
417
440
  'prettier/prettier': [
418
441
  2,
419
442
  {
420
- parser: 'angular',
443
+ parser: 'html',
421
444
  },
422
445
  ],
423
446
  },
424
447
  },
425
448
  {
426
- files: '*inline-template-*.component.html',
427
- rules: {
428
- 'unicorn/no-empty-file': 0,
429
- },
449
+ files: '*.pug',
450
+ extends: ['plugin:markup/recommended', 'plugin:prettier/recommended'],
430
451
  },
431
452
  ]
432
453
 
433
- exports.html = {
434
- files: '*.html',
435
- extends: 'plugin:markup/recommended',
436
- rules: {
437
- 'prettier/prettier': [
438
- 2,
439
- {
440
- parser: 'html',
441
- },
442
- ],
443
- },
444
- }
445
-
446
454
  exports.md = {
447
455
  files: '*.md',
448
456
  extends: ['plugin:mdx/recommended'],
@@ -489,18 +497,7 @@ exports.config = exports.configs = {
489
497
 
490
498
  exports.json = {
491
499
  files: ['.*rc', '*.json'],
492
- excludedFiles: [
493
- '.browserslistrc',
494
- '.npmrc',
495
- '.nvmrc',
496
- '.yarnrc',
497
- '.*shrc',
498
- 'angular.json',
499
- 'jsconfig.json',
500
- 'settings.json',
501
- 'tsconfig.json',
502
- 'tsconfig.*.json',
503
- ],
500
+ excludedFiles: [...nonJsonRcFiles, ...jsoncFiles],
504
501
  extends: [
505
502
  'plugin:jsonc/recommended-with-json',
506
503
  // eslint-disable-next-line sonarjs/no-duplicate-string
@@ -511,14 +508,7 @@ exports.json = {
511
508
  }
512
509
 
513
510
  exports.jsonc = {
514
- files: [
515
- '*.jsonc',
516
- 'angular.json',
517
- 'jsconfig.json',
518
- 'settings.json',
519
- 'tsconfig.json',
520
- 'tsconfig.*.json',
521
- ],
511
+ files: jsoncFiles,
522
512
  extends: [
523
513
  'plugin:jsonc/recommended-with-jsonc',
524
514
  'plugin:json-schema-validator/recommended',
@@ -560,9 +550,11 @@ exports.overrides = []
560
550
  isReactAvailable && exports.react,
561
551
  isReactAvailable && exports.reactHooks,
562
552
  isReactAvailable && exports.reactTs,
553
+ // The order matters, the later should to be preferred
554
+ exports.markup,
555
+ isAngularAvailable && exports.angular,
563
556
  isVueAvailable && exports.vue,
564
557
  isSvelteAvailable && exports.svelte,
565
- isAngularAvailable ? exports.angular : exports.html,
566
558
  exports.md,
567
559
  exports.mdx,
568
560
  isPkgAvailable('jest') && exports.jest,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@1stg/eslint-config",
3
- "version": "5.2.5",
4
- "description": "Personal but Shareable ESLint Configuration for all 1stG.me projects.",
3
+ "version": "5.3.1",
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",
7
7
  "author": "JounQin (https://www.1stG.me) <admin@1stg.me>",
@@ -45,12 +45,13 @@
45
45
  "eslint": ">=6.0.0"
46
46
  },
47
47
  "dependencies": {
48
+ "@1stg/config": "^0.1.0",
48
49
  "@angular-eslint/eslint-plugin": "^14.0.0",
49
50
  "@angular-eslint/eslint-plugin-template": "^14.0.0",
50
51
  "@angular-eslint/template-parser": "^14.0.0",
51
52
  "@babel/eslint-parser": "^7.18.2",
52
53
  "@babel/eslint-plugin": "^7.17.7",
53
- "@pkgr/utils": "^2.2.0",
54
+ "@pkgr/utils": "^2.3.0",
54
55
  "@typescript-eslint/eslint-plugin": "^5.30.5",
55
56
  "@typescript-eslint/parser": "^5.30.5",
56
57
  "angular-eslint-template-parser": "^0.1.1",
@@ -59,16 +60,16 @@
59
60
  "eslint-config-standard-jsx": "^11.0.0",
60
61
  "eslint-config-standard-react": "^11.0.1",
61
62
  "eslint-formatter-friendly": "^7.0.0",
62
- "eslint-import-resolver-typescript": "^3.2.1",
63
+ "eslint-import-resolver-typescript": "^3.2.4",
63
64
  "eslint-plugin-css": "^0.6.0",
64
65
  "eslint-plugin-es-x": "^5.2.1",
65
66
  "eslint-plugin-eslint-comments": "^3.2.0",
66
67
  "eslint-plugin-import": "^2.26.0",
67
68
  "eslint-plugin-jest": "^26.5.3",
68
69
  "eslint-plugin-jsdoc": "^39.3.3",
69
- "eslint-plugin-json-schema-validator": "^3.1.2",
70
+ "eslint-plugin-json-schema-validator": "^3.1.3",
70
71
  "eslint-plugin-jsonc": "^2.3.1",
71
- "eslint-plugin-markup": "^0.9.0",
72
+ "eslint-plugin-markup": "^0.10.0",
72
73
  "eslint-plugin-mdx": "^2.0.1",
73
74
  "eslint-plugin-n": "^15.2.4",
74
75
  "eslint-plugin-prettier": "^4.2.1",
@@ -79,13 +80,13 @@
79
80
  "eslint-plugin-simple-import-sort": "^7.0.0",
80
81
  "eslint-plugin-sonar": "^0.8.0",
81
82
  "eslint-plugin-sonarjs": "^0.13.0",
82
- "eslint-plugin-svelte": "^2.1.0",
83
+ "eslint-plugin-svelte": "^2.2.0",
83
84
  "eslint-plugin-toml": "^0.3.1",
84
- "eslint-plugin-unicorn": "^43.0.0",
85
- "eslint-plugin-vue": "^9.1.1",
85
+ "eslint-plugin-unicorn": "^43.0.1",
86
+ "eslint-plugin-vue": "^9.2.0",
86
87
  "eslint-plugin-yml": "^1.0.0"
87
88
  },
88
89
  "publishConfig": {
89
90
  "access": "public"
90
91
  }
91
- }
92
+ }