@1stg/eslint-config 5.3.0 → 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,11 @@
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
+
3
9
  ## 5.3.0
4
10
 
5
11
  ### Minor 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/overrides.js CHANGED
@@ -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,
@@ -356,6 +366,7 @@ exports.vue = [
356
366
  const svelteBase = {
357
367
  files: '*.svelte',
358
368
  extends: [
369
+ 'plugin:markup/recommended',
359
370
  'plugin:svelte/recommended',
360
371
  'plugin:svelte/prettier',
361
372
  'plugin:prettier/recommended',
@@ -389,7 +400,7 @@ exports.angular = [
389
400
  extends: [
390
401
  'plugin:@angular-eslint/recommended',
391
402
  'plugin:@angular-eslint/template/process-inline-templates',
392
- 'prettier',
403
+ 'plugin:prettier/recommended',
393
404
  ],
394
405
  rules: {
395
406
  '@angular-eslint/prefer-on-push-component-change-detection': 1,
@@ -400,6 +411,7 @@ exports.angular = [
400
411
  extends: [
401
412
  'plugin:@angular-eslint/template/recommended',
402
413
  'plugin:markup/recommended',
414
+ 'plugin:prettier/recommended',
403
415
  ],
404
416
  parser: 'angular-eslint-template-parser',
405
417
  rules: {
@@ -409,44 +421,36 @@ exports.angular = [
409
421
  allowNullOrUndefined: true,
410
422
  },
411
423
  ],
412
- 'prettier/prettier': 0,
413
424
  'spaced-comment': 0,
414
425
  },
415
426
  },
427
+ {
428
+ files: '*inline-template-*.component.html',
429
+ rules: {
430
+ 'unicorn/no-empty-file': 0,
431
+ },
432
+ },
433
+ ]
434
+
435
+ exports.markup = [
416
436
  {
417
437
  files: '*.html',
418
- excludedFiles: '*inline-template-*.component.html',
419
- extends: ['prettier'],
438
+ extends: 'plugin:markup/recommended',
420
439
  rules: {
421
440
  'prettier/prettier': [
422
441
  2,
423
442
  {
424
- parser: 'angular',
443
+ parser: 'html',
425
444
  },
426
445
  ],
427
446
  },
428
447
  },
429
448
  {
430
- files: '*inline-template-*.component.html',
431
- rules: {
432
- 'unicorn/no-empty-file': 0,
433
- },
449
+ files: '*.pug',
450
+ extends: ['plugin:markup/recommended', 'plugin:prettier/recommended'],
434
451
  },
435
452
  ]
436
453
 
437
- exports.html = {
438
- files: '*.html',
439
- extends: 'plugin:markup/recommended',
440
- rules: {
441
- 'prettier/prettier': [
442
- 2,
443
- {
444
- parser: 'html',
445
- },
446
- ],
447
- },
448
- }
449
-
450
454
  exports.md = {
451
455
  files: '*.md',
452
456
  extends: ['plugin:mdx/recommended'],
@@ -546,9 +550,11 @@ exports.overrides = []
546
550
  isReactAvailable && exports.react,
547
551
  isReactAvailable && exports.reactHooks,
548
552
  isReactAvailable && exports.reactTs,
553
+ // The order matters, the later should to be preferred
554
+ exports.markup,
555
+ isAngularAvailable && exports.angular,
549
556
  isVueAvailable && exports.vue,
550
557
  isSvelteAvailable && exports.svelte,
551
- isAngularAvailable ? exports.angular : exports.html,
552
558
  exports.md,
553
559
  exports.mdx,
554
560
  isPkgAvailable('jest') && exports.jest,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1stg/eslint-config",
3
- "version": "5.3.0",
3
+ "version": "5.3.1",
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",
@@ -82,11 +82,11 @@
82
82
  "eslint-plugin-sonarjs": "^0.13.0",
83
83
  "eslint-plugin-svelte": "^2.2.0",
84
84
  "eslint-plugin-toml": "^0.3.1",
85
- "eslint-plugin-unicorn": "^43.0.0",
85
+ "eslint-plugin-unicorn": "^43.0.1",
86
86
  "eslint-plugin-vue": "^9.2.0",
87
87
  "eslint-plugin-yml": "^1.0.0"
88
88
  },
89
89
  "publishConfig": {
90
90
  "access": "public"
91
91
  }
92
- }
92
+ }