linter-bundle 2.27.0 → 2.28.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 +49 -1
- package/README.md +4 -1
- package/TODO.md +9 -0
- package/eslint/index.js +21 -20
- package/eslint/overrides-gatsby.js +1 -9
- package/eslint/overrides-javascript-lazy.js +21 -11
- package/eslint/overrides-javascript.js +1 -1
- package/eslint/overrides-jsdoc.js +8 -5
- package/eslint/overrides-storybook.js +1 -1
- package/lint.js +51 -37
- package/package.json +22 -22
- package/stylelint/index.js +90 -77
- package/stylelint/plugins/stylelint-high-performance-animation.js +1 -0
- package/stylelint/plugins/stylelint-selector-tag-no-without-class.js +1 -0
- package/stylelint/plugins/stylelint-stylistic.js +187 -0
- package/validate-stylelint-options.js +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -6,7 +6,55 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
-
[Show all code changes](https://github.com/jens-duttke/linter-bundle/compare/v2.
|
|
9
|
+
[Show all code changes](https://github.com/jens-duttke/linter-bundle/compare/v2.28.0...HEAD)
|
|
10
|
+
|
|
11
|
+
## [2.28.0] - 2023-04-21
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- [eslint] Updated `@typescript-eslint` from `5.49.0` to `5.59.0`
|
|
16
|
+
- [eslint] Updated `eslint` from `8.32.0` to `8.39.0`
|
|
17
|
+
- [eslint] Updated `eslint-import-resolver-typescript` from `3.5.3` to `3.5.5`
|
|
18
|
+
- [eslint] Updated `eslint-plugin-functional` from `4.4.1` to `5.0.8`
|
|
19
|
+
- [eslint] Updated `eslint-plugin-jsdoc` from `39.6.9` to `43.0.7`
|
|
20
|
+
- [eslint] Updated `eslint-plugin-n` from `15.6.1` to `15.7.0`
|
|
21
|
+
- [eslint] Updated `eslint-plugin-react` from `7.32.1` to `7.32.2`
|
|
22
|
+
- [eslint] Updated `eslint-plugin-unicorn` from `45.0.2` to `46.0.0`
|
|
23
|
+
- [stylelint] Updated `stylelint` from `14.16.1` to `15.5.0`
|
|
24
|
+
- [stylelint] Updated `stylelint-declaration-block-no-ignored-properties` from `2.6.0` to `2.7.0`
|
|
25
|
+
- [stylelint] Updated `stylelint-order` from `6.0.1` to `6.0.3`
|
|
26
|
+
- [stylelint] Updated `stylelint-scss` from `4.3.0` to `4.6.0`
|
|
27
|
+
- [stylelint] Updated `stylelint-use-logical-spec` from `4.1.0` to `5.0.0`
|
|
28
|
+
- [eslint] Consider JavaScript files with the '.mjs' file extension (ECMAScript Modules)
|
|
29
|
+
- [eslint] Activated [`react/destructuring-assignment`](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/destructuring-assignment.md) rule
|
|
30
|
+
- [stylelint] Since all 76 stylistic Stylelint rules have been marked as deprecated, code to fork them has been implemented
|
|
31
|
+
|
|
32
|
+
### Added
|
|
33
|
+
|
|
34
|
+
- [eslint] Added new [`@typescript-eslint/key-spacing`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/key-spacing.md) rule
|
|
35
|
+
- [eslint] Added new [`@typescript-eslint/no-duplicate-type-constituents.md`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-duplicate-type-constituents.md) rule
|
|
36
|
+
- [eslint] Added new [`@typescript-eslint/no-import-type-side-effects`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-import-type-side-effects.md) rule
|
|
37
|
+
- [eslint] Added new [`@typescript-eslint/no-mixed-enums`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-mixed-enums.md) rule
|
|
38
|
+
- [eslint] Added new [`@typescript-eslint/no-unsafe-enum-comparison`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-unsafe-enum-comparison.md) rule
|
|
39
|
+
- [eslint] Added new [`@typescript-eslint/sort-type-constituents`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/sort-type-constituents.md) rule
|
|
40
|
+
- [eslint] Added new [`no-constant-binary-expression`](https://github.com/eslint/eslint/blob/main/docs/src/rules/no-constant-binary-expression.md) rule
|
|
41
|
+
- [eslint] Added new [`functional/prefer-immutable-types`](https://github.com/eslint-functional/eslint-plugin-functional/blob/main/docs/rules/prefer-immutable-types.md) rule, but disabled it
|
|
42
|
+
- [eslint] Added new [`functional/readonly-type`](https://github.com/eslint-functional/eslint-plugin-functional/blob/main/docs/rules/readonly-type.md) rule with option `keyword`
|
|
43
|
+
- [eslint] Added new [`functional/type-declaration-immutability`](https://github.com/eslint-functional/eslint-plugin-functional/blob/main/docs/rules/type-declaration-immutability.md) rule, but disabled it
|
|
44
|
+
- [stylelint] Added new [`declaration-property-value-no-unknown`](https://github.com/stylelint/stylelint/blob/main/lib/rules/declaration-property-value-no-unknown/README.md) rule
|
|
45
|
+
- [stylelint] Added new [`media-feature-name-unit-allowed-list`](https://github.com/stylelint/stylelint/blob/main/lib/rules/media-feature-name-unit-allowed-list/README.md) rule, but disabled it
|
|
46
|
+
- [stylelint] Added new [`no-unknown-custom-properties`](https://github.com/stylelint/stylelint/blob/main/lib/rules/no-unknown-custom-properties/README.md) rule, but disabled
|
|
47
|
+
- [stylelint] Added new [`selector-anb-no-unmatchable`](https://github.com/stylelint/stylelint/blob/main/lib/rules/selector-anb-no-unmatchable/README.md) rule
|
|
48
|
+
|
|
49
|
+
### Removed
|
|
50
|
+
|
|
51
|
+
- [eslint] Removed deprecated rule `functional/prefer-readonly-type`
|
|
52
|
+
- [eslint/overrides-jsdoc] Removed deprecated rule `jsdoc/newline-after-description`
|
|
53
|
+
- [stylelint] Removed deprecated rule `at-rule-name-newline-after`
|
|
54
|
+
- [stylelint] Removed deprecated rule `block-closing-brace-space-after`
|
|
55
|
+
- [stylelint] Removed deprecated rule `block-opening-brace-newline-before`
|
|
56
|
+
|
|
57
|
+
[Show all code changes](https://github.com/jens-duttke/linter-bundle/compare/v2.27.0...v2.28.0)
|
|
10
58
|
|
|
11
59
|
## [2.27.0] - 2023-01-27
|
|
12
60
|
|
package/README.md
CHANGED
|
@@ -278,7 +278,7 @@ Argument | Description | Example
|
|
|
278
278
|
Will execute:
|
|
279
279
|
|
|
280
280
|
```sh
|
|
281
|
-
eslint "./**/*.{js,jsx,ts,tsx}" --format unix
|
|
281
|
+
eslint "./**/*.{js,mjs,jsx,ts,tsx}" --format unix
|
|
282
282
|
```
|
|
283
283
|
|
|
284
284
|
Additionally, the environment variable `TIMING` is set to `10`.
|
|
@@ -397,6 +397,9 @@ To visualize the max line-length rules in VSCode, you can activate rulers, by ad
|
|
|
397
397
|
|
|
398
398
|
```json
|
|
399
399
|
{
|
|
400
|
+
"[javascript]": {
|
|
401
|
+
"editor.rulers": [300]
|
|
402
|
+
},
|
|
400
403
|
"[markdown]": {
|
|
401
404
|
"editor.rulers": [300]
|
|
402
405
|
},
|
package/TODO.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
<!-- markdownlint-disable -->
|
|
4
4
|
|
|
5
|
+
- Keine Hard-kodierten HexEdit-spezifischen Werte:
|
|
6
|
+
react: {
|
|
7
|
+
'react/forbid-component-props': {
|
|
8
|
+
allowClassNameFor: ['Checkbox', 'Grid', 'GridItem', 'Button'],
|
|
9
|
+
allowStyleFor: []
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
Diese müssen konfigurierbar sein. Hier gibt es neu auch `disallowFor`, aber ggf. sollte das gesammte Konfig-Objekt von aussen kommen.
|
|
13
|
+
|
|
5
14
|
- Bereiche in Readme aufklappbar machen:
|
|
6
15
|
<details>
|
|
7
16
|
summary>yarn</summary>
|
package/eslint/index.js
CHANGED
|
@@ -98,7 +98,6 @@ module.exports = {
|
|
|
98
98
|
|
|
99
99
|
/**
|
|
100
100
|
* eslint
|
|
101
|
-
*
|
|
102
101
|
* @see https://eslint.org/docs/rules/
|
|
103
102
|
*/
|
|
104
103
|
'accessor-pairs': 'error',
|
|
@@ -149,7 +148,7 @@ module.exports = {
|
|
|
149
148
|
'indent': 'off', // Covered by @typescript-eslint/indent
|
|
150
149
|
'init-declarations': 'off', // @todo It should be possible to ignore predefined consts like MAX_RADIX
|
|
151
150
|
'jsx-quotes': 'error',
|
|
152
|
-
'key-spacing': '
|
|
151
|
+
'key-spacing': 'off', // Covered by @typescript-eslint/key-spacing
|
|
153
152
|
'keyword-spacing': 'error',
|
|
154
153
|
'line-comment-position': 'off',
|
|
155
154
|
'linebreak-style': 'error',
|
|
@@ -188,6 +187,7 @@ module.exports = {
|
|
|
188
187
|
'no-confusing-arrow': ['error', { allowParens: true }],
|
|
189
188
|
'no-console': 'error',
|
|
190
189
|
'no-const-assign': 'error',
|
|
190
|
+
'no-constant-binary-expression': 'error',
|
|
191
191
|
'no-constant-condition': 'error',
|
|
192
192
|
'no-constructor-return': 'error',
|
|
193
193
|
'no-continue': 'off', // If it makes the code more readable, wer are using `continue`
|
|
@@ -387,7 +387,6 @@ module.exports = {
|
|
|
387
387
|
|
|
388
388
|
/**
|
|
389
389
|
* typescript-eslint
|
|
390
|
-
*
|
|
391
390
|
* @see https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules
|
|
392
391
|
*/
|
|
393
392
|
'@typescript-eslint/adjacent-overload-signatures': 'error',
|
|
@@ -463,6 +462,7 @@ module.exports = {
|
|
|
463
462
|
ignoredNodes: ['ConditionalExpression']
|
|
464
463
|
}
|
|
465
464
|
],
|
|
465
|
+
'@typescript-eslint/key-spacing': 'error',
|
|
466
466
|
'@typescript-eslint/member-delimiter-style': ['error', { multiline: { delimiter: 'semi', requireLast: true }, singleline: { delimiter: 'semi', requireLast: true } }],
|
|
467
467
|
'@typescript-eslint/member-ordering': ['error', {
|
|
468
468
|
default: [
|
|
@@ -654,6 +654,7 @@ module.exports = {
|
|
|
654
654
|
'@typescript-eslint/no-confusing-void-expression': ['error', { ignoreArrowShorthand: true, ignoreVoidOperator: true }],
|
|
655
655
|
'@typescript-eslint/no-dupe-class-members': 'error',
|
|
656
656
|
'@typescript-eslint/no-duplicate-enum-values': 'error',
|
|
657
|
+
'@typescript-eslint/no-duplicate-type-constituents': 'error',
|
|
657
658
|
'@typescript-eslint/no-dynamic-delete': 'error',
|
|
658
659
|
'@typescript-eslint/no-empty-function': 'error',
|
|
659
660
|
'@typescript-eslint/no-empty-interface': 'off',
|
|
@@ -665,6 +666,7 @@ module.exports = {
|
|
|
665
666
|
'@typescript-eslint/no-floating-promises': 'error',
|
|
666
667
|
'@typescript-eslint/no-for-in-array': 'error',
|
|
667
668
|
'@typescript-eslint/no-implicit-any-catch': 'off', // Results into false-positive with the TS4.4 option "useUnknownInCatchVariables"
|
|
669
|
+
'@typescript-eslint/no-import-type-side-effects': 'error',
|
|
668
670
|
'@typescript-eslint/no-inferrable-types': 'off', // Sometimes an explicit type helps to understand the code better
|
|
669
671
|
'@typescript-eslint/no-invalid-this': 'error',
|
|
670
672
|
'@typescript-eslint/no-invalid-void-type': ['error', { allowInGenericTypeArguments: true }],
|
|
@@ -681,6 +683,7 @@ module.exports = {
|
|
|
681
683
|
'@typescript-eslint/no-meaningless-void-operator': 'error',
|
|
682
684
|
'@typescript-eslint/no-misused-new': 'error',
|
|
683
685
|
'@typescript-eslint/no-misused-promises': ['error', { checksVoidReturn: false }],
|
|
686
|
+
'@typescript-eslint/no-mixed-enums': 'error',
|
|
684
687
|
'@typescript-eslint/no-namespace': ['error', { allowDeclarations: true }],
|
|
685
688
|
'@typescript-eslint/no-non-null-assertion': 'error',
|
|
686
689
|
'@typescript-eslint/no-non-null-asserted-optional-chain': 'error',
|
|
@@ -714,6 +717,7 @@ module.exports = {
|
|
|
714
717
|
'@typescript-eslint/no-unsafe-assignment': 'error',
|
|
715
718
|
'@typescript-eslint/no-unsafe-call': 'error',
|
|
716
719
|
'@typescript-eslint/no-unsafe-declaration-merging': 'error',
|
|
720
|
+
'@typescript-eslint/no-unsafe-enum-comparison': 'error',
|
|
717
721
|
'@typescript-eslint/no-unsafe-member-access': 'error',
|
|
718
722
|
'@typescript-eslint/no-unsafe-return': 'error',
|
|
719
723
|
'@typescript-eslint/no-unused-expressions': 'error',
|
|
@@ -752,6 +756,7 @@ module.exports = {
|
|
|
752
756
|
}],
|
|
753
757
|
'@typescript-eslint/return-await': 'error',
|
|
754
758
|
'@typescript-eslint/semi': 'error',
|
|
759
|
+
'@typescript-eslint/sort-type-constituents': 'off', // Types should be sorted and grouped by priority and their meaning, not alphabetically
|
|
755
760
|
'@typescript-eslint/sort-type-union-intersection-members': 'off', // Types should be sorted and grouped by priority and their meaning, not alphabetically
|
|
756
761
|
'@typescript-eslint/space-before-function-paren': 'error',
|
|
757
762
|
'@typescript-eslint/space-infix-ops': 'error',
|
|
@@ -765,37 +770,37 @@ module.exports = {
|
|
|
765
770
|
|
|
766
771
|
/**
|
|
767
772
|
* eslint-plugin-functional
|
|
768
|
-
*
|
|
769
773
|
* @see https://github.com/jonaskello/eslint-plugin-functional#supported-rules
|
|
770
774
|
*/
|
|
771
775
|
'functional/functional-parameters': 'off',
|
|
772
776
|
'functional/immutable-data': 'off', // This rule would require a lot of additional code and workarounds, which would make the result much more illegible.
|
|
773
|
-
'functional/no-
|
|
774
|
-
'functional/no-conditional-
|
|
775
|
-
'functional/no-expression-
|
|
777
|
+
'functional/no-classes': 'off',
|
|
778
|
+
'functional/no-conditional-statements': 'off',
|
|
779
|
+
'functional/no-expression-statements': ['off', { ignoreVoid: true }], // Creates too much false-positives
|
|
776
780
|
'functional/no-let': 'off', // This is better covered by the `prefer-const` rule
|
|
777
|
-
'functional/no-loop-
|
|
778
|
-
'functional/no-
|
|
779
|
-
'functional/no-mixed-type': ['error', {
|
|
781
|
+
'functional/no-loop-statements': 'off',
|
|
782
|
+
'functional/no-mixed-types': ['error', {
|
|
780
783
|
checkInterfaces: false,
|
|
781
784
|
checkTypeLiterals: true
|
|
782
785
|
}],
|
|
783
786
|
'functional/no-promise-reject': 'off',
|
|
784
787
|
'functional/no-return-void': 'off',
|
|
785
|
-
'functional/no-this-
|
|
786
|
-
'functional/no-throw-
|
|
787
|
-
'functional/no-try-
|
|
788
|
-
'functional/prefer-
|
|
788
|
+
'functional/no-this-expressions': 'off',
|
|
789
|
+
'functional/no-throw-statements': 'off',
|
|
790
|
+
'functional/no-try-statements': 'off',
|
|
791
|
+
'functional/prefer-immutable-types': 'off',
|
|
792
|
+
'functional/prefer-property-signatures': 'off', // Covered by @typescript-eslint/method-signature-style
|
|
789
793
|
'functional/prefer-tacit': 'off', // @see https://github.com/jonaskello/eslint-plugin-functional/issues/263
|
|
794
|
+
'functional/readonly-type': ['error', 'keyword'],
|
|
795
|
+
'functional/type-declaration-immutability': 'off',
|
|
790
796
|
|
|
791
797
|
/**
|
|
792
798
|
* eslint-plugin-import
|
|
793
|
-
*
|
|
794
799
|
* @see https://github.com/import-js/eslint-plugin-import
|
|
795
800
|
*/
|
|
796
801
|
'import/consistent-type-specifier-style': ['error', 'prefer-top-level'],
|
|
797
802
|
'import/default': 'error',
|
|
798
|
-
'import/dynamic-import-chunkname': ['
|
|
803
|
+
'import/dynamic-import-chunkname': ['error', {
|
|
799
804
|
webpackChunknameFormat: '[0-9a-zA-Z-_/.+]+'
|
|
800
805
|
}],
|
|
801
806
|
'import/export': 'error',
|
|
@@ -854,7 +859,6 @@ module.exports = {
|
|
|
854
859
|
...ensureType.array(global.linterBundleSettings?.overrides?.general?.['import/order']?.additionalExternalPatterns).map(
|
|
855
860
|
/**
|
|
856
861
|
* Creates an "external" group using the additional external pattern configuration.
|
|
857
|
-
*
|
|
858
862
|
* @param {string} pattern - A given pattern
|
|
859
863
|
* @returns {{ pattern: string; group: 'external'; }} An "external" path configuration object
|
|
860
864
|
*/
|
|
@@ -871,7 +875,6 @@ module.exports = {
|
|
|
871
875
|
|
|
872
876
|
/**
|
|
873
877
|
* eslint-plugin-eslint-comments
|
|
874
|
-
*
|
|
875
878
|
* @see https://mysticatea.github.io/eslint-plugin-eslint-comments/
|
|
876
879
|
*/
|
|
877
880
|
'eslint-comments/disable-enable-pair': ['error', { allowWholeFile: true }],
|
|
@@ -886,7 +889,6 @@ module.exports = {
|
|
|
886
889
|
|
|
887
890
|
/**
|
|
888
891
|
* eslint-plugin-promise
|
|
889
|
-
*
|
|
890
892
|
* @see https://github.com/xjamundx/eslint-plugin-promise
|
|
891
893
|
*/
|
|
892
894
|
'promise/always-return': 'off', // If the result of an `.then()` is not used, there is no need to return something.
|
|
@@ -907,7 +909,6 @@ module.exports = {
|
|
|
907
909
|
|
|
908
910
|
/**
|
|
909
911
|
* eslint-plugin-unicorn
|
|
910
|
-
*
|
|
911
912
|
* @see https://github.com/sindresorhus/eslint-plugin-unicorn
|
|
912
913
|
*/
|
|
913
914
|
'unicorn/better-regex': 'error',
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file Settings for Gatsby-based projects.
|
|
3
|
+
*
|
|
3
4
|
*/
|
|
4
5
|
|
|
5
6
|
module.exports = {
|
|
@@ -14,10 +15,8 @@ module.exports = {
|
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
17
|
* eslint
|
|
17
|
-
*
|
|
18
18
|
* @see https://eslint.org/docs/rules/
|
|
19
19
|
*/
|
|
20
|
-
|
|
21
20
|
'no-restricted-imports': ['error', {
|
|
22
21
|
paths: [{
|
|
23
22
|
name: '@reach/router',
|
|
@@ -28,21 +27,18 @@ module.exports = {
|
|
|
28
27
|
|
|
29
28
|
/**
|
|
30
29
|
* typescript-eslint
|
|
31
|
-
*
|
|
32
30
|
* @see https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules
|
|
33
31
|
*/
|
|
34
32
|
'@typescript-eslint/no-confusing-void-expression': 'off', // @todo Conflicts with graphql-template strings
|
|
35
33
|
|
|
36
34
|
/**
|
|
37
35
|
* eslint-plugin-import
|
|
38
|
-
*
|
|
39
36
|
* @see https://github.com/import-js/eslint-plugin-import
|
|
40
37
|
*/
|
|
41
38
|
'import/no-unresolved': ['error', { caseSensitiveStrict: true, ignore: ['@reach/router'] }],
|
|
42
39
|
|
|
43
40
|
/**
|
|
44
41
|
* eslint-plugin-unicorn
|
|
45
|
-
*
|
|
46
42
|
* @see https://github.com/sindresorhus/eslint-plugin-unicorn
|
|
47
43
|
*/
|
|
48
44
|
'unicorn/string-content': ['error', {
|
|
@@ -64,7 +60,6 @@ module.exports = {
|
|
|
64
60
|
rules: {
|
|
65
61
|
/**
|
|
66
62
|
* eslint-plugin-unicorn
|
|
67
|
-
*
|
|
68
63
|
* @see https://github.com/sindresorhus/eslint-plugin-unicorn
|
|
69
64
|
*/
|
|
70
65
|
'unicorn/filename-case': ['error', {
|
|
@@ -83,7 +78,6 @@ module.exports = {
|
|
|
83
78
|
rules: {
|
|
84
79
|
/**
|
|
85
80
|
* eslint-plugin-import
|
|
86
|
-
*
|
|
87
81
|
* @see https://github.com/import-js/eslint-plugin-import
|
|
88
82
|
*/
|
|
89
83
|
'import/no-default-export': 'off',
|
|
@@ -91,7 +85,6 @@ module.exports = {
|
|
|
91
85
|
|
|
92
86
|
/**
|
|
93
87
|
* eslint-plugin-unicorn
|
|
94
|
-
*
|
|
95
88
|
* @see https://github.com/sindresorhus/eslint-plugin-unicorn
|
|
96
89
|
*/
|
|
97
90
|
'unicorn/filename-case': ['error', {
|
|
@@ -106,7 +99,6 @@ module.exports = {
|
|
|
106
99
|
rules: {
|
|
107
100
|
/**
|
|
108
101
|
* eslint-plugin-n
|
|
109
|
-
*
|
|
110
102
|
* @see https://github.com/eslint-community/eslint-plugin-n
|
|
111
103
|
*/
|
|
112
104
|
'n/no-unsupported-features/es-syntax': 'off'
|
|
@@ -4,15 +4,25 @@
|
|
|
4
4
|
|
|
5
5
|
const overridesJavaScript = require('./overrides-javascript');
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
overridesJavaScript.overrides[0].rules
|
|
14
|
-
overridesJavaScript.overrides[0].rules['@typescript-eslint/no-unsafe-call'] = 'off';
|
|
15
|
-
overridesJavaScript.overrides[0].rules['@typescript-eslint/no-unsafe-member-access'] = 'off';
|
|
16
|
-
overridesJavaScript.overrides[0].rules['@typescript-eslint/no-unsafe-return'] = 'off';
|
|
7
|
+
module.exports = {
|
|
8
|
+
...overridesJavaScript,
|
|
9
|
+
overrides: [
|
|
10
|
+
{
|
|
11
|
+
...overridesJavaScript.overrides[0],
|
|
12
|
+
rules: {
|
|
13
|
+
...overridesJavaScript.overrides[0].rules,
|
|
17
14
|
|
|
18
|
-
|
|
15
|
+
/**
|
|
16
|
+
* typescript-eslint
|
|
17
|
+
*
|
|
18
|
+
* @see https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules
|
|
19
|
+
*/
|
|
20
|
+
'@typescript-eslint/no-unsafe-argument': 'off',
|
|
21
|
+
'@typescript-eslint/no-unsafe-assignment': 'off',
|
|
22
|
+
'@typescript-eslint/no-unsafe-call': 'off',
|
|
23
|
+
'@typescript-eslint/no-unsafe-member-access': 'off',
|
|
24
|
+
'@typescript-eslint/no-unsafe-return': 'off'
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
};
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
module.exports = {
|
|
6
6
|
overrides: [
|
|
7
7
|
{
|
|
8
|
-
files: ['*.js'],
|
|
8
|
+
files: ['*.js', '.mjs'],
|
|
9
9
|
env: {
|
|
10
10
|
node: true,
|
|
11
11
|
es6: true
|
|
@@ -20,7 +20,6 @@ module.exports = {
|
|
|
20
20
|
rules: {
|
|
21
21
|
/**
|
|
22
22
|
* "eslint-plugin-jsdoc" rules
|
|
23
|
-
*
|
|
24
23
|
* @see https://github.com/gajus/eslint-plugin-jsdoc
|
|
25
24
|
*/
|
|
26
25
|
'jsdoc/check-access': 'error',
|
|
@@ -38,7 +37,6 @@ module.exports = {
|
|
|
38
37
|
'jsdoc/match-description': 'error',
|
|
39
38
|
'jsdoc/match-name': 'off',
|
|
40
39
|
'jsdoc/multiline-blocks': ['error', { noSingleLineBlocks: true, singleLineTags: ['lends', 'type', 'typedef'], noFinalLineText: false }],
|
|
41
|
-
'jsdoc/newline-after-description': 'error',
|
|
42
40
|
'jsdoc/no-bad-blocks': 'error',
|
|
43
41
|
'jsdoc/no-defaults': 'off',
|
|
44
42
|
'jsdoc/no-missing-syntax': 'off',
|
|
@@ -64,17 +62,22 @@ module.exports = {
|
|
|
64
62
|
'jsdoc/require-throws': 'error',
|
|
65
63
|
'jsdoc/require-yields': 'error',
|
|
66
64
|
'jsdoc/require-yields-check': 'error',
|
|
67
|
-
'jsdoc/tag-lines': ['error', '
|
|
65
|
+
'jsdoc/tag-lines': ['error', 'always', {
|
|
68
66
|
tags: {
|
|
69
67
|
example: { lines: 'always' },
|
|
70
68
|
file: { lines: 'always' },
|
|
71
69
|
fileOverview: { lines: 'always' },
|
|
70
|
+
license: { lines: 'always' },
|
|
71
|
+
see: { lines: 'never' },
|
|
72
|
+
template: { lines: 'never' },
|
|
72
73
|
param: { lines: 'never' },
|
|
73
74
|
private: { lines: 'never' },
|
|
74
75
|
protected: { lines: 'never' },
|
|
75
76
|
public: { lines: 'never' }
|
|
76
77
|
},
|
|
77
|
-
|
|
78
|
+
startLines: null,
|
|
79
|
+
endLines: null,
|
|
80
|
+
applyToEndTag: false
|
|
78
81
|
}],
|
|
79
82
|
'jsdoc/text-escaping': 'off', // Right now, there is no description of this rule available on the page. Only the discussion here: https://github.com/gajus/eslint-plugin-jsdoc/issues/864
|
|
80
83
|
'jsdoc/valid-types': 'off' // Checked by TypeScript
|
package/lint.js
CHANGED
|
@@ -77,7 +77,7 @@ void (async () => {
|
|
|
77
77
|
case 'ts': {
|
|
78
78
|
const tsconfig = config['tsconfig']?.[0];
|
|
79
79
|
|
|
80
|
-
const includes = getIncludes(gitFiles, './**/*.{js,jsx,ts,tsx}', config);
|
|
80
|
+
const includes = getIncludes(gitFiles, './**/*.{js,mjs,jsx,ts,tsx}', config);
|
|
81
81
|
|
|
82
82
|
if (!includes) {
|
|
83
83
|
return generateDummyJobOutput(taskName, config, {
|
|
@@ -142,44 +142,52 @@ void (async () => {
|
|
|
142
142
|
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete -- This is not a valid `audit` property, so we need to remove it.
|
|
143
143
|
delete config['git'];
|
|
144
144
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
145
|
+
switch (npmOrYarn) {
|
|
146
|
+
case 'npm':
|
|
147
|
+
return runTask({
|
|
148
|
+
taskName,
|
|
149
|
+
config,
|
|
150
|
+
command: [
|
|
151
|
+
'npx',
|
|
152
|
+
'--yes',
|
|
153
|
+
'--',
|
|
154
|
+
'better-npm-audit@1.9.1',
|
|
155
|
+
'audit',
|
|
156
|
+
`-l ${config['min-severity'] ?? 'moderate'}`,
|
|
157
|
+
'-p',
|
|
158
|
+
config['exclude']?.map((exclude) => `-i ${exclude}`).join(' ')
|
|
159
|
+
].filter((argument) => Boolean(argument)).join(' ')
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
case 'yarn':
|
|
163
|
+
return runTask({
|
|
164
|
+
taskName,
|
|
165
|
+
config,
|
|
166
|
+
command: [
|
|
167
|
+
'npx',
|
|
168
|
+
'--yes',
|
|
169
|
+
'--',
|
|
170
|
+
'improved-yarn-audit@2.3.3',
|
|
171
|
+
`--min-severity ${config['min-severity'] ?? 'moderate'}`,
|
|
172
|
+
'--fail-on-missing-exclusions',
|
|
173
|
+
'--ignore-dev-deps',
|
|
174
|
+
config['exclude']?.map((exclude) => `--exclude ${exclude}`).join(' ')
|
|
175
|
+
].filter((argument) => Boolean(argument)).join(' ')
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
case 'both':
|
|
179
|
+
return generateDummyJobOutput(taskName, config, {
|
|
180
|
+
code: 1,
|
|
181
|
+
stderr: 'A "package-lock.json" and "yarn.lock" have been found. Use only one package manager within the project to avoid potential conflicts.'
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
default:
|
|
185
|
+
return generateDummyJobOutput(taskName, config, {
|
|
186
|
+
code: 1,
|
|
187
|
+
stderr: 'Neither a "package-lock.json" nor a "yarn.lock" have been found.'
|
|
188
|
+
});
|
|
176
189
|
}
|
|
177
190
|
|
|
178
|
-
return generateDummyJobOutput(taskName, config, {
|
|
179
|
-
code: 1,
|
|
180
|
-
stderr: 'Neither a "package-lock.json" nor a "yarn.lock" have need found.'
|
|
181
|
-
});
|
|
182
|
-
|
|
183
191
|
default:
|
|
184
192
|
}
|
|
185
193
|
|
|
@@ -242,6 +250,7 @@ void (async () => {
|
|
|
242
250
|
*
|
|
243
251
|
* @param {ReturnType<isNpmOrYarn>} npmOrYarn - This should be the return value of `isNpmOrYarn()`.
|
|
244
252
|
* @returns {boolean} Returns `true` if the environment is valid, otherwise `false` is returned.
|
|
253
|
+
*
|
|
245
254
|
*/
|
|
246
255
|
function validateEnvironment (npmOrYarn) {
|
|
247
256
|
const outdatedOverrides = validatePackageOverrides();
|
|
@@ -294,6 +303,7 @@ function validateEnvironment (npmOrYarn) {
|
|
|
294
303
|
*
|
|
295
304
|
* @param {string[]} argv - Command-line arguments (usual `process.argv.splice(2)`)
|
|
296
305
|
* @returns {TaskNameAndConfig[]} The task execution setup.
|
|
306
|
+
*
|
|
297
307
|
* @throws {Error} If no task has be specified in the arguments.
|
|
298
308
|
*/
|
|
299
309
|
function getTasksToRun (argv) {
|
|
@@ -360,6 +370,7 @@ function getTasksToRun (argv) {
|
|
|
360
370
|
* @param {string} pattern - Glob pattern
|
|
361
371
|
* @param {Partial<Record<string, (string | true)[]>>} config - Linter configuration
|
|
362
372
|
* @returns {string} Space-separated file names in double-quotes to be used in the command-line, or an empty string if no file matches.
|
|
373
|
+
*
|
|
363
374
|
*/
|
|
364
375
|
function getIncludes (list, pattern, config) {
|
|
365
376
|
const include = config['include']?.[0];
|
|
@@ -382,6 +393,7 @@ function getIncludes (list, pattern, config) {
|
|
|
382
393
|
*
|
|
383
394
|
* @param {TaskSetup} setup - The task execution setup.
|
|
384
395
|
* @returns {Job} Job
|
|
396
|
+
*
|
|
385
397
|
*/
|
|
386
398
|
function runTask (setup) {
|
|
387
399
|
return {
|
|
@@ -398,6 +410,7 @@ function runTask (setup) {
|
|
|
398
410
|
* @param {Partial<Record<string, (string | true)[]>>} config - The configuration of the task.
|
|
399
411
|
* @param {{ code?: number; stdout?: string; stderr?: string; }} output - The output which should be returned as result of the job.
|
|
400
412
|
* @returns {Job} Job
|
|
413
|
+
*
|
|
401
414
|
*/
|
|
402
415
|
function generateDummyJobOutput (taskName, config, output) {
|
|
403
416
|
return {
|
|
@@ -426,6 +439,7 @@ function generateDummyJobOutput (taskName, config, output) {
|
|
|
426
439
|
*
|
|
427
440
|
* @param {TaskSetup} setup - The task execution setup.
|
|
428
441
|
* @returns {string} The title of the job with a leading line-break and two trailing line-breaks.
|
|
442
|
+
*
|
|
429
443
|
*/
|
|
430
444
|
function getJobTitle (setup) {
|
|
431
445
|
/** @type {string} */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "linter-bundle",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.28.0",
|
|
4
4
|
"description": "Ready-to use bundle of linting tools, containing configurations for ESLint, stylelint and markdownlint.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -32,50 +32,50 @@
|
|
|
32
32
|
"publish:major": "npm version major",
|
|
33
33
|
"publish:minor": "npm version minor",
|
|
34
34
|
"publish:patch": "npm version patch",
|
|
35
|
-
"lint": "npm run validate-stylelint-options && node ./lint tsc ts md audit --min-severity=critical",
|
|
36
|
-
"preversion": "npm run check-outdated && npm run
|
|
35
|
+
"lint": "npm run validate-stylelint-options && npm run stylelint-find-rules && node ./lint tsc ts md audit --min-severity=critical",
|
|
36
|
+
"preversion": "npm run check-outdated && npm run lint",
|
|
37
37
|
"postversion": "git push && git push --tags && npm publish",
|
|
38
38
|
"stylelint-find-rules": "stylelint-find-new-rules ./stylelint/index.js",
|
|
39
39
|
"validate-stylelint-options": "node ./validate-stylelint-options",
|
|
40
40
|
"check-outdated": "npx --yes -- check-outdated --ignore-pre-releases"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
44
|
-
"@typescript-eslint/parser": "5.
|
|
45
|
-
"@typescript-eslint/utils": "5.
|
|
46
|
-
"eslint": "8.
|
|
47
|
-
"eslint-import-resolver-typescript": "3.5.
|
|
43
|
+
"@typescript-eslint/eslint-plugin": "5.59.0",
|
|
44
|
+
"@typescript-eslint/parser": "5.59.0",
|
|
45
|
+
"@typescript-eslint/utils": "5.59.0",
|
|
46
|
+
"eslint": "8.39.0",
|
|
47
|
+
"eslint-import-resolver-typescript": "3.5.5",
|
|
48
48
|
"eslint-import-resolver-webpack": "0.13.2",
|
|
49
49
|
"eslint-plugin-eslint-comments": "3.2.0",
|
|
50
|
-
"eslint-plugin-functional": "
|
|
50
|
+
"eslint-plugin-functional": "5.0.8",
|
|
51
51
|
"eslint-plugin-import": "2.27.5",
|
|
52
52
|
"eslint-plugin-jest": "27.2.1",
|
|
53
|
-
"eslint-plugin-jsdoc": "
|
|
53
|
+
"eslint-plugin-jsdoc": "43.0.7",
|
|
54
54
|
"eslint-plugin-jsx-a11y": "6.7.1",
|
|
55
|
-
"eslint-plugin-n": "15.
|
|
55
|
+
"eslint-plugin-n": "15.7.0",
|
|
56
56
|
"eslint-plugin-promise": "6.1.1",
|
|
57
|
-
"eslint-plugin-react": "7.32.
|
|
57
|
+
"eslint-plugin-react": "7.32.2",
|
|
58
58
|
"eslint-plugin-react-hooks": "4.6.0",
|
|
59
|
-
"eslint-plugin-unicorn": "
|
|
59
|
+
"eslint-plugin-unicorn": "46.0.0",
|
|
60
60
|
"markdownlint-cli": "0.33.0",
|
|
61
61
|
"micromatch": "4.0.5",
|
|
62
62
|
"postcss-scss": "4.0.6",
|
|
63
|
-
"stylelint": "
|
|
64
|
-
"stylelint-declaration-block-no-ignored-properties": "2.
|
|
65
|
-
"stylelint-order": "6.0.
|
|
66
|
-
"stylelint-scss": "4.
|
|
63
|
+
"stylelint": "15.5.0",
|
|
64
|
+
"stylelint-declaration-block-no-ignored-properties": "2.7.0",
|
|
65
|
+
"stylelint-order": "6.0.3",
|
|
66
|
+
"stylelint-scss": "4.6.0",
|
|
67
67
|
"stylelint-selector-no-empty": "1.0.9",
|
|
68
|
-
"stylelint-use-logical-spec": "
|
|
68
|
+
"stylelint-use-logical-spec": "5.0.0"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
71
|
"postcss-value-parser": "*",
|
|
72
72
|
"typescript": "^4.0.0"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
|
-
"@types/eslint": "8.
|
|
75
|
+
"@types/eslint": "8.37.0",
|
|
76
76
|
"@types/micromatch": "4.0.2",
|
|
77
|
-
"@types/node": "18.
|
|
78
|
-
"stylelint-find-new-rules": "4.
|
|
79
|
-
"typescript": "
|
|
77
|
+
"@types/node": "18.15.13",
|
|
78
|
+
"stylelint-find-new-rules": "4.1.0",
|
|
79
|
+
"typescript": "5.0.4"
|
|
80
80
|
}
|
|
81
81
|
}
|
package/stylelint/index.js
CHANGED
|
@@ -18,7 +18,8 @@ module.exports = {
|
|
|
18
18
|
'stylelint-selector-no-empty',
|
|
19
19
|
'stylelint-use-logical-spec',
|
|
20
20
|
path.join(__dirname, '/plugins/stylelint-high-performance-animation.js'),
|
|
21
|
-
path.join(__dirname, '/plugins/stylelint-selector-tag-no-without-class.js')
|
|
21
|
+
path.join(__dirname, '/plugins/stylelint-selector-tag-no-without-class.js'),
|
|
22
|
+
path.join(__dirname, '/plugins/stylelint-stylistic.js')
|
|
22
23
|
],
|
|
23
24
|
overrides: [
|
|
24
25
|
{
|
|
@@ -83,29 +84,14 @@ module.exports = {
|
|
|
83
84
|
]
|
|
84
85
|
}
|
|
85
86
|
],
|
|
86
|
-
'at-rule-name-case': 'lower',
|
|
87
|
-
'at-rule-name-newline-after': null,
|
|
88
|
-
'at-rule-name-space-after': 'always-single-line',
|
|
89
87
|
'at-rule-no-unknown': null, // scss/at-rule-no-unknown
|
|
90
88
|
'at-rule-no-vendor-prefix': true,
|
|
91
89
|
'at-rule-property-required-list': [{
|
|
92
90
|
'font-face': ['font-family', 'font-style', 'font-weight', 'src']
|
|
93
91
|
}],
|
|
94
|
-
'at-rule-semicolon-newline-after': 'always',
|
|
95
|
-
'at-rule-semicolon-space-before': 'never',
|
|
96
|
-
'block-closing-brace-empty-line-before': 'never',
|
|
97
|
-
'block-closing-brace-newline-after': 'always',
|
|
98
|
-
'block-closing-brace-newline-before': 'always-multi-line',
|
|
99
|
-
'block-closing-brace-space-after': null,
|
|
100
|
-
'block-closing-brace-space-before': 'always-single-line',
|
|
101
92
|
'block-no-empty': true,
|
|
102
|
-
'block-opening-brace-newline-after': 'always-multi-line',
|
|
103
|
-
'block-opening-brace-newline-before': null,
|
|
104
|
-
'block-opening-brace-space-after': 'always-single-line',
|
|
105
|
-
'block-opening-brace-space-before': 'always',
|
|
106
93
|
'color-function-notation': null, // @todo Doesn't work with variables like: hsl(var(--xyz)). Create issue. Later change that to 'modern'.
|
|
107
94
|
'color-hex-alpha': null, // @todo Not widely supported yet. Activate in 2024.
|
|
108
|
-
'color-hex-case': 'lower',
|
|
109
95
|
'color-hex-length': 'short',
|
|
110
96
|
'color-named': 'never',
|
|
111
97
|
'color-no-hex': true,
|
|
@@ -125,8 +111,6 @@ module.exports = {
|
|
|
125
111
|
'custom-property-empty-line-before': null, // Empty lines between custom properties are optional
|
|
126
112
|
'custom-property-no-missing-var-function': true,
|
|
127
113
|
'custom-property-pattern': (global.linterBundleSettings?.patternPrefix ? `${global.linterBundleSettings.patternPrefix}-[a-z][a-zA-Z]+(-[a-z][a-zA-Z]+\\d*)*` : null),
|
|
128
|
-
'declaration-bang-space-after': 'never',
|
|
129
|
-
'declaration-bang-space-before': 'always',
|
|
130
114
|
'declaration-block-no-duplicate-custom-properties': true,
|
|
131
115
|
'declaration-block-no-duplicate-properties': [
|
|
132
116
|
true,
|
|
@@ -136,15 +120,7 @@ module.exports = {
|
|
|
136
120
|
],
|
|
137
121
|
'declaration-block-no-redundant-longhand-properties': [true, { ignoreShorthands: [/^grid-template/u] }],
|
|
138
122
|
'declaration-block-no-shorthand-property-overrides': true,
|
|
139
|
-
'declaration-block-semicolon-newline-after': 'always-multi-line',
|
|
140
|
-
'declaration-block-semicolon-newline-before': 'never-multi-line',
|
|
141
|
-
'declaration-block-semicolon-space-after': 'always-single-line',
|
|
142
|
-
'declaration-block-semicolon-space-before': 'never',
|
|
143
123
|
'declaration-block-single-line-max-declarations': 1,
|
|
144
|
-
'declaration-block-trailing-semicolon': 'always',
|
|
145
|
-
'declaration-colon-newline-after': 'always-multi-line',
|
|
146
|
-
'declaration-colon-space-after': 'always-single-line',
|
|
147
|
-
'declaration-colon-space-before': 'never',
|
|
148
124
|
'declaration-empty-line-before': [
|
|
149
125
|
'always',
|
|
150
126
|
{
|
|
@@ -171,74 +147,55 @@ module.exports = {
|
|
|
171
147
|
'declaration-property-unit-disallowed-list': null,
|
|
172
148
|
'declaration-property-value-allowed-list': null,
|
|
173
149
|
'declaration-property-value-disallowed-list': null,
|
|
150
|
+
'declaration-property-value-no-unknown': [
|
|
151
|
+
true,
|
|
152
|
+
{
|
|
153
|
+
ignoreProperties: {
|
|
154
|
+
'initial-value': '/.+/'
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
],
|
|
174
158
|
'font-family-name-quotes': 'always-where-recommended',
|
|
175
159
|
'font-family-no-duplicate-names': true,
|
|
176
160
|
'font-family-no-missing-generic-family-keyword': true,
|
|
177
161
|
'font-weight-notation': 'numeric',
|
|
178
162
|
'function-allowed-list': null,
|
|
179
163
|
'function-calc-no-unspaced-operator': true,
|
|
180
|
-
'function-comma-newline-after': 'always-multi-line',
|
|
181
|
-
'function-comma-newline-before': 'never-multi-line',
|
|
182
|
-
'function-comma-space-after': 'always-single-line',
|
|
183
|
-
'function-comma-space-before': 'never',
|
|
184
164
|
'function-disallowed-list': null,
|
|
185
165
|
'function-linear-gradient-no-nonstandard-direction': true,
|
|
186
|
-
'function-max-empty-lines': 0,
|
|
187
166
|
'function-name-case': 'lower',
|
|
188
167
|
'function-no-unknown': null, // Implemented by scss/function-no-unknown
|
|
189
|
-
'function-parentheses-newline-inside': 'always-multi-line',
|
|
190
|
-
'function-parentheses-space-inside': 'never-single-line',
|
|
191
168
|
'function-url-no-scheme-relative': true,
|
|
192
169
|
'function-url-quotes': 'always',
|
|
193
170
|
'function-url-scheme-disallowed-list': null,
|
|
194
171
|
'function-url-scheme-allowed-list': null,
|
|
195
|
-
'function-whitespace-after': 'always',
|
|
196
172
|
'hue-degree-notation': 'number', // @todo change that to 'angle'?
|
|
197
173
|
'import-notation': null, // This rule, does not make sense. `node_modules` dependencies need to use `url("css_bundle")`, while project files are using only a string.
|
|
198
|
-
'indentation': 'tab',
|
|
199
174
|
'keyframe-block-no-duplicate-selectors': true,
|
|
200
175
|
'keyframe-declaration-no-important': true,
|
|
201
176
|
'keyframe-selector-notation': 'percentage',
|
|
202
177
|
'keyframes-name-pattern': '^[a-z]+(-[a-z]+)*\\d*$',
|
|
203
178
|
'length-zero-no-unit': true,
|
|
204
|
-
'linebreaks': 'unix',
|
|
205
|
-
'max-empty-lines': 1,
|
|
206
|
-
'max-line-length': 160,
|
|
207
179
|
'max-nesting-depth': 6,
|
|
208
|
-
'media-feature-colon-space-after': 'always',
|
|
209
|
-
'media-feature-colon-space-before': 'never',
|
|
210
180
|
'media-feature-name-allowed-list': null,
|
|
211
|
-
'media-feature-name-case': 'lower',
|
|
212
181
|
'media-feature-name-disallowed-list': null,
|
|
213
182
|
'media-feature-name-no-unknown': true,
|
|
214
183
|
'media-feature-name-no-vendor-prefix': null, // For Safari, we still need "-webkit-min-device-pixel-ratio": https://caniuse.com/css-media-resolution
|
|
184
|
+
'media-feature-name-unit-allowed-list': null,
|
|
215
185
|
'media-feature-name-value-allowed-list': null,
|
|
216
|
-
'media-feature-parentheses-space-inside': 'never',
|
|
217
186
|
'media-feature-range-notation': 'prefix',
|
|
218
|
-
'media-feature-range-operator-space-after': 'always',
|
|
219
|
-
'media-feature-range-operator-space-before': 'always',
|
|
220
|
-
'media-query-list-comma-newline-after': 'always-multi-line',
|
|
221
|
-
'media-query-list-comma-newline-before': 'never-multi-line',
|
|
222
|
-
'media-query-list-comma-space-after': 'always-single-line',
|
|
223
|
-
'media-query-list-comma-space-before': 'never',
|
|
224
187
|
'named-grid-areas-no-invalid': true,
|
|
225
188
|
'no-descending-specificity': null, // doesn't work in many cases (e.g. while using the SCSS :global()-pseudo-class)
|
|
226
189
|
'no-duplicate-at-import-rules': true,
|
|
227
190
|
'no-duplicate-selectors': true,
|
|
228
|
-
'no-empty-first-line': true,
|
|
229
191
|
'no-empty-source': true,
|
|
230
|
-
'no-eol-whitespace': true,
|
|
231
|
-
'no-extra-semicolons': true,
|
|
232
192
|
'no-invalid-double-slash-comments': true,
|
|
233
193
|
'no-invalid-position-at-import-rule': true,
|
|
234
194
|
'no-irregular-whitespace': true,
|
|
235
|
-
'no-missing-end-of-source-newline': true,
|
|
236
195
|
'no-unknown-animations': true,
|
|
237
|
-
'
|
|
196
|
+
'no-unknown-custom-properties': null, // @todo Activate in 2025 as Firefox currently does not support "@property" and there is no way to specify which custom properties are available
|
|
238
197
|
'number-max-precision': 5,
|
|
239
|
-
'number-no-trailing-zeros': true,
|
|
240
198
|
'property-allowed-list': null,
|
|
241
|
-
'property-case': 'lower',
|
|
242
199
|
'property-disallowed-list': [
|
|
243
200
|
'font', // Shorthand property is to complex
|
|
244
201
|
'grid-gap', // @deprecated Use gap.
|
|
@@ -258,30 +215,20 @@ module.exports = {
|
|
|
258
215
|
ignore: ['after-comment']
|
|
259
216
|
}
|
|
260
217
|
],
|
|
261
|
-
'selector-
|
|
218
|
+
'selector-anb-no-unmatchable': true,
|
|
262
219
|
'selector-attribute-name-disallowed-list': null,
|
|
263
220
|
'selector-attribute-operator-allowed-list': null,
|
|
264
221
|
'selector-attribute-operator-disallowed-list': null,
|
|
265
|
-
'selector-attribute-operator-space-after': 'never',
|
|
266
|
-
'selector-attribute-operator-space-before': 'never',
|
|
267
222
|
'selector-attribute-quotes': 'always',
|
|
268
223
|
'selector-class-pattern': null,
|
|
269
224
|
'selector-combinator-allowed-list': null,
|
|
270
225
|
'selector-combinator-disallowed-list': null,
|
|
271
|
-
'selector-combinator-space-after': 'always',
|
|
272
|
-
'selector-combinator-space-before': 'always',
|
|
273
|
-
'selector-descendant-combinator-no-non-space': true,
|
|
274
226
|
'selector-disallowed-list': null,
|
|
275
227
|
'selector-id-pattern': '^[a-z]+(-[a-z]+)*$',
|
|
276
|
-
'selector-list-comma-newline-after': 'always',
|
|
277
|
-
'selector-list-comma-newline-before': 'never-multi-line',
|
|
278
|
-
'selector-list-comma-space-after': 'always-single-line',
|
|
279
|
-
'selector-list-comma-space-before': 'never',
|
|
280
228
|
'selector-max-attribute': 1,
|
|
281
229
|
'selector-max-class': 5,
|
|
282
230
|
'selector-max-combinators': 5,
|
|
283
231
|
'selector-max-compound-selectors': 5,
|
|
284
|
-
'selector-max-empty-lines': 0,
|
|
285
232
|
'selector-max-id': 1,
|
|
286
233
|
'selector-max-pseudo-class': 3,
|
|
287
234
|
'selector-max-specificity': [
|
|
@@ -297,12 +244,9 @@ module.exports = {
|
|
|
297
244
|
'selector-no-vendor-prefix': true,
|
|
298
245
|
'selector-not-notation': null, // 'complex', @todo Reactivate in 2024. Disabled for now, because it depends on the project if modern Selectors Level 4 CSS can be used.
|
|
299
246
|
'selector-pseudo-class-allowed-list': null,
|
|
300
|
-
'selector-pseudo-class-case': 'lower',
|
|
301
247
|
'selector-pseudo-class-disallowed-list': null,
|
|
302
248
|
'selector-pseudo-class-no-unknown': [true, { ignorePseudoClasses: ['global'] }],
|
|
303
|
-
'selector-pseudo-class-parentheses-space-inside': 'never',
|
|
304
249
|
'selector-pseudo-element-allowed-list': null,
|
|
305
|
-
'selector-pseudo-element-case': 'lower',
|
|
306
250
|
'selector-pseudo-element-disallowed-list': null,
|
|
307
251
|
'selector-pseudo-element-colon-notation': 'double',
|
|
308
252
|
'selector-pseudo-element-no-unknown': true,
|
|
@@ -310,11 +254,8 @@ module.exports = {
|
|
|
310
254
|
'selector-type-no-unknown': true,
|
|
311
255
|
'shorthand-property-no-redundant-values': true,
|
|
312
256
|
'string-no-newline': true,
|
|
313
|
-
'string-quotes': 'double',
|
|
314
257
|
'time-min-milliseconds': 40, // @todo For the delay of transitions 40ms should be the minimum, for the duration 150ms should be the minimum (change it, as soon as https://github.com/stylelint/stylelint/issues/4552 got implemented)
|
|
315
|
-
'unicode-bom': 'never',
|
|
316
258
|
'unit-allowed-list': null,
|
|
317
|
-
'unit-case': 'lower',
|
|
318
259
|
'unit-disallowed-list': null,
|
|
319
260
|
'unit-no-unknown': true,
|
|
320
261
|
'value-keyword-case': [
|
|
@@ -323,11 +264,6 @@ module.exports = {
|
|
|
323
264
|
camelCaseSvgKeywords: true
|
|
324
265
|
}
|
|
325
266
|
],
|
|
326
|
-
'value-list-comma-newline-after': 'always-multi-line',
|
|
327
|
-
'value-list-comma-newline-before': 'never-multi-line',
|
|
328
|
-
'value-list-comma-space-after': 'always-single-line',
|
|
329
|
-
'value-list-comma-space-before': 'never',
|
|
330
|
-
'value-list-max-empty-lines': 0,
|
|
331
267
|
'value-no-vendor-prefix': true,
|
|
332
268
|
|
|
333
269
|
/**
|
|
@@ -347,6 +283,83 @@ module.exports = {
|
|
|
347
283
|
severity: 'warning'
|
|
348
284
|
}],
|
|
349
285
|
|
|
286
|
+
/**
|
|
287
|
+
* stylelint-stylistic rules
|
|
288
|
+
*/
|
|
289
|
+
'plugin/at-rule-name-case': 'lower',
|
|
290
|
+
'plugin/at-rule-name-space-after': 'always-single-line',
|
|
291
|
+
'plugin/at-rule-semicolon-newline-after': 'always',
|
|
292
|
+
'plugin/at-rule-semicolon-space-before': 'never',
|
|
293
|
+
'plugin/block-closing-brace-empty-line-before': 'never',
|
|
294
|
+
'plugin/block-closing-brace-newline-after': 'always',
|
|
295
|
+
'plugin/block-closing-brace-newline-before': 'always-multi-line',
|
|
296
|
+
'plugin/block-closing-brace-space-before': 'always-single-line',
|
|
297
|
+
'plugin/block-opening-brace-newline-after': 'always-multi-line',
|
|
298
|
+
'plugin/block-opening-brace-space-after': 'always-single-line',
|
|
299
|
+
'plugin/block-opening-brace-space-before': 'always',
|
|
300
|
+
'plugin/color-hex-case': 'lower',
|
|
301
|
+
'plugin/declaration-bang-space-after': 'never',
|
|
302
|
+
'plugin/declaration-bang-space-before': 'always',
|
|
303
|
+
'plugin/declaration-block-semicolon-newline-after': 'always-multi-line',
|
|
304
|
+
'plugin/declaration-block-semicolon-newline-before': 'never-multi-line',
|
|
305
|
+
'plugin/declaration-block-semicolon-space-after': 'always-single-line',
|
|
306
|
+
'plugin/declaration-block-semicolon-space-before': 'never',
|
|
307
|
+
'plugin/declaration-block-trailing-semicolon': 'always',
|
|
308
|
+
'plugin/declaration-colon-newline-after': 'always-multi-line',
|
|
309
|
+
'plugin/declaration-colon-space-after': 'always-single-line',
|
|
310
|
+
'plugin/declaration-colon-space-before': 'never',
|
|
311
|
+
'plugin/function-comma-newline-after': 'always-multi-line',
|
|
312
|
+
'plugin/function-comma-newline-before': 'never-multi-line',
|
|
313
|
+
'plugin/function-comma-space-after': 'always-single-line',
|
|
314
|
+
'plugin/function-comma-space-before': 'never',
|
|
315
|
+
'plugin/function-max-empty-lines': 0,
|
|
316
|
+
'plugin/function-parentheses-newline-inside': 'always-multi-line',
|
|
317
|
+
'plugin/function-parentheses-space-inside': 'never-single-line',
|
|
318
|
+
'plugin/function-whitespace-after': 'always',
|
|
319
|
+
'plugin/indentation': 'tab',
|
|
320
|
+
'plugin/linebreaks': 'unix',
|
|
321
|
+
'plugin/max-empty-lines': 1,
|
|
322
|
+
'plugin/max-line-length': 160,
|
|
323
|
+
'plugin/media-feature-colon-space-after': 'always',
|
|
324
|
+
'plugin/media-feature-colon-space-before': 'never',
|
|
325
|
+
'plugin/media-feature-name-case': 'lower',
|
|
326
|
+
'plugin/media-feature-parentheses-space-inside': 'never',
|
|
327
|
+
'plugin/media-feature-range-operator-space-after': 'always',
|
|
328
|
+
'plugin/media-feature-range-operator-space-before': 'always',
|
|
329
|
+
'plugin/media-query-list-comma-newline-after': 'always-multi-line',
|
|
330
|
+
'plugin/media-query-list-comma-newline-before': 'never-multi-line',
|
|
331
|
+
'plugin/media-query-list-comma-space-after': 'always-single-line',
|
|
332
|
+
'plugin/media-query-list-comma-space-before': 'never',
|
|
333
|
+
'plugin/no-empty-first-line': true,
|
|
334
|
+
'plugin/no-eol-whitespace': true,
|
|
335
|
+
'plugin/no-extra-semicolons': true,
|
|
336
|
+
'plugin/no-missing-end-of-source-newline': true,
|
|
337
|
+
'plugin/number-leading-zero': 'always',
|
|
338
|
+
'plugin/number-no-trailing-zeros': true,
|
|
339
|
+
'plugin/property-case': 'lower',
|
|
340
|
+
'plugin/selector-attribute-brackets-space-inside': 'never',
|
|
341
|
+
'plugin/selector-attribute-operator-space-after': 'never',
|
|
342
|
+
'plugin/selector-attribute-operator-space-before': 'never',
|
|
343
|
+
'plugin/selector-combinator-space-after': 'always',
|
|
344
|
+
'plugin/selector-combinator-space-before': 'always',
|
|
345
|
+
'plugin/selector-descendant-combinator-no-non-space': true,
|
|
346
|
+
'plugin/selector-list-comma-newline-after': 'always',
|
|
347
|
+
'plugin/selector-list-comma-newline-before': 'never-multi-line',
|
|
348
|
+
'plugin/selector-list-comma-space-after': 'always-single-line',
|
|
349
|
+
'plugin/selector-list-comma-space-before': 'never',
|
|
350
|
+
'plugin/selector-max-empty-lines': 0,
|
|
351
|
+
'plugin/selector-pseudo-class-case': 'lower',
|
|
352
|
+
'plugin/selector-pseudo-class-parentheses-space-inside': 'never',
|
|
353
|
+
'plugin/selector-pseudo-element-case': 'lower',
|
|
354
|
+
'plugin/string-quotes': 'double',
|
|
355
|
+
'plugin/unicode-bom': 'never',
|
|
356
|
+
'plugin/unit-case': 'lower',
|
|
357
|
+
'plugin/value-list-comma-newline-after': 'always-multi-line',
|
|
358
|
+
'plugin/value-list-comma-newline-before': 'never-multi-line',
|
|
359
|
+
'plugin/value-list-comma-space-after': 'always-single-line',
|
|
360
|
+
'plugin/value-list-comma-space-before': 'never',
|
|
361
|
+
'plugin/value-list-max-empty-lines': 0,
|
|
362
|
+
|
|
350
363
|
/**
|
|
351
364
|
* stylelint-order
|
|
352
365
|
*
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Fork of the stylistic Stylelint rules.
|
|
3
|
+
*
|
|
4
|
+
* Stylistic rules have been deprecated in Stylelint v15 and will be removed in Stylelint v16, in favour of Prettier.
|
|
5
|
+
* To provide a smooth transition, we will fork them from the latest 15.x version which will contain them.
|
|
6
|
+
*
|
|
7
|
+
* The following stylistic rules are not considered, as they are not used by `linter-bundle`:
|
|
8
|
+
* - at-rule-name-newline-after
|
|
9
|
+
* - block-closing-brace-space-after
|
|
10
|
+
* - block-opening-brace-newline-before
|
|
11
|
+
*
|
|
12
|
+
* @license MIT
|
|
13
|
+
*
|
|
14
|
+
* @see https://stylelint.io/user-guide/rules/at-rule-name-case
|
|
15
|
+
* @see https://stylelint.io/user-guide/rules/at-rule-name-space-after
|
|
16
|
+
* @see https://stylelint.io/user-guide/rules/at-rule-semicolon-newline-after
|
|
17
|
+
* @see https://stylelint.io/user-guide/rules/at-rule-semicolon-space-before
|
|
18
|
+
* @see https://stylelint.io/user-guide/rules/block-closing-brace-empty-line-before
|
|
19
|
+
* @see https://stylelint.io/user-guide/rules/block-closing-brace-newline-after
|
|
20
|
+
* @see https://stylelint.io/user-guide/rules/block-closing-brace-newline-before
|
|
21
|
+
* @see https://stylelint.io/user-guide/rules/block-closing-brace-space-before
|
|
22
|
+
* @see https://stylelint.io/user-guide/rules/block-opening-brace-newline-after
|
|
23
|
+
* @see https://stylelint.io/user-guide/rules/block-opening-brace-space-after
|
|
24
|
+
* @see https://stylelint.io/user-guide/rules/block-opening-brace-space-before
|
|
25
|
+
* @see https://stylelint.io/user-guide/rules/color-hex-case
|
|
26
|
+
* @see https://stylelint.io/user-guide/rules/declaration-bang-space-after
|
|
27
|
+
* @see https://stylelint.io/user-guide/rules/declaration-bang-space-before
|
|
28
|
+
* @see https://stylelint.io/user-guide/rules/declaration-block-semicolon-newline-after
|
|
29
|
+
* @see https://stylelint.io/user-guide/rules/declaration-block-semicolon-newline-before
|
|
30
|
+
* @see https://stylelint.io/user-guide/rules/declaration-block-semicolon-space-after
|
|
31
|
+
* @see https://stylelint.io/user-guide/rules/declaration-block-semicolon-space-before
|
|
32
|
+
* @see https://stylelint.io/user-guide/rules/declaration-block-trailing-semicolon
|
|
33
|
+
* @see https://stylelint.io/user-guide/rules/declaration-colon-newline-after
|
|
34
|
+
* @see https://stylelint.io/user-guide/rules/declaration-colon-space-after
|
|
35
|
+
* @see https://stylelint.io/user-guide/rules/declaration-colon-space-before
|
|
36
|
+
* @see https://stylelint.io/user-guide/rules/function-comma-newline-after
|
|
37
|
+
* @see https://stylelint.io/user-guide/rules/function-comma-newline-before
|
|
38
|
+
* @see https://stylelint.io/user-guide/rules/function-comma-space-after
|
|
39
|
+
* @see https://stylelint.io/user-guide/rules/function-comma-space-before
|
|
40
|
+
* @see https://stylelint.io/user-guide/rules/function-max-empty-lines
|
|
41
|
+
* @see https://stylelint.io/user-guide/rules/function-parentheses-newline-inside
|
|
42
|
+
* @see https://stylelint.io/user-guide/rules/function-parentheses-space-inside
|
|
43
|
+
* @see https://stylelint.io/user-guide/rules/function-whitespace-after
|
|
44
|
+
* @see https://stylelint.io/user-guide/rules/indentation
|
|
45
|
+
* @see https://stylelint.io/user-guide/rules/linebreaks
|
|
46
|
+
* @see https://stylelint.io/user-guide/rules/max-empty-lines
|
|
47
|
+
* @see https://stylelint.io/user-guide/rules/max-line-length
|
|
48
|
+
* @see https://stylelint.io/user-guide/rules/media-feature-colon-space-after
|
|
49
|
+
* @see https://stylelint.io/user-guide/rules/media-feature-colon-space-before
|
|
50
|
+
* @see https://stylelint.io/user-guide/rules/media-feature-name-case
|
|
51
|
+
* @see https://stylelint.io/user-guide/rules/media-feature-parentheses-space-inside
|
|
52
|
+
* @see https://stylelint.io/user-guide/rules/media-feature-range-operator-space-after
|
|
53
|
+
* @see https://stylelint.io/user-guide/rules/media-feature-range-operator-space-before
|
|
54
|
+
* @see https://stylelint.io/user-guide/rules/media-query-list-comma-newline-after
|
|
55
|
+
* @see https://stylelint.io/user-guide/rules/media-query-list-comma-newline-before
|
|
56
|
+
* @see https://stylelint.io/user-guide/rules/media-query-list-comma-space-after
|
|
57
|
+
* @see https://stylelint.io/user-guide/rules/media-query-list-comma-space-before
|
|
58
|
+
* @see https://stylelint.io/user-guide/rules/no-empty-first-line
|
|
59
|
+
* @see https://stylelint.io/user-guide/rules/no-eol-whitespace
|
|
60
|
+
* @see https://stylelint.io/user-guide/rules/no-extra-semicolons
|
|
61
|
+
* @see https://stylelint.io/user-guide/rules/no-missing-end-of-source-newline
|
|
62
|
+
* @see https://stylelint.io/user-guide/rules/number-leading-zero
|
|
63
|
+
* @see https://stylelint.io/user-guide/rules/number-no-trailing-zeros
|
|
64
|
+
* @see https://stylelint.io/user-guide/rules/property-case
|
|
65
|
+
* @see https://stylelint.io/user-guide/rules/selector-attribute-brackets-space-inside
|
|
66
|
+
* @see https://stylelint.io/user-guide/rules/selector-attribute-operator-space-after
|
|
67
|
+
* @see https://stylelint.io/user-guide/rules/selector-attribute-operator-space-before
|
|
68
|
+
* @see https://stylelint.io/user-guide/rules/selector-combinator-space-after
|
|
69
|
+
* @see https://stylelint.io/user-guide/rules/selector-combinator-space-before
|
|
70
|
+
* @see https://stylelint.io/user-guide/rules/selector-descendant-combinator-no-non-space
|
|
71
|
+
* @see https://stylelint.io/user-guide/rules/selector-list-comma-newline-after
|
|
72
|
+
* @see https://stylelint.io/user-guide/rules/selector-list-comma-newline-before
|
|
73
|
+
* @see https://stylelint.io/user-guide/rules/selector-list-comma-space-after
|
|
74
|
+
* @see https://stylelint.io/user-guide/rules/selector-list-comma-space-before
|
|
75
|
+
* @see https://stylelint.io/user-guide/rules/selector-max-empty-lines
|
|
76
|
+
* @see https://stylelint.io/user-guide/rules/selector-pseudo-class-case
|
|
77
|
+
* @see https://stylelint.io/user-guide/rules/selector-pseudo-class-parentheses-space-inside
|
|
78
|
+
* @see https://stylelint.io/user-guide/rules/selector-pseudo-element-case
|
|
79
|
+
* @see https://stylelint.io/user-guide/rules/string-quotes
|
|
80
|
+
* @see https://stylelint.io/user-guide/rules/unicode-bom
|
|
81
|
+
* @see https://stylelint.io/user-guide/rules/unit-case
|
|
82
|
+
* @see https://stylelint.io/user-guide/rules/value-list-comma-newline-after
|
|
83
|
+
* @see https://stylelint.io/user-guide/rules/value-list-comma-newline-before
|
|
84
|
+
* @see https://stylelint.io/user-guide/rules/value-list-comma-space-after
|
|
85
|
+
* @see https://stylelint.io/user-guide/rules/value-list-comma-space-before
|
|
86
|
+
* @see https://stylelint.io/user-guide/rules/value-list-max-empty-lines
|
|
87
|
+
*/
|
|
88
|
+
|
|
89
|
+
const stylelint = require('stylelint');
|
|
90
|
+
|
|
91
|
+
module.exports = [
|
|
92
|
+
'at-rule-name-case',
|
|
93
|
+
'at-rule-name-space-after',
|
|
94
|
+
'at-rule-semicolon-newline-after',
|
|
95
|
+
'at-rule-semicolon-space-before',
|
|
96
|
+
'block-closing-brace-empty-line-before',
|
|
97
|
+
'block-closing-brace-newline-after',
|
|
98
|
+
'block-closing-brace-newline-before',
|
|
99
|
+
'block-closing-brace-space-before',
|
|
100
|
+
'block-opening-brace-newline-after',
|
|
101
|
+
'block-opening-brace-space-after',
|
|
102
|
+
'block-opening-brace-space-before',
|
|
103
|
+
'color-hex-case',
|
|
104
|
+
'declaration-bang-space-after',
|
|
105
|
+
'declaration-bang-space-before',
|
|
106
|
+
'declaration-block-semicolon-newline-after',
|
|
107
|
+
'declaration-block-semicolon-newline-before',
|
|
108
|
+
'declaration-block-semicolon-space-after',
|
|
109
|
+
'declaration-block-semicolon-space-before',
|
|
110
|
+
'declaration-block-trailing-semicolon',
|
|
111
|
+
'declaration-colon-newline-after',
|
|
112
|
+
'declaration-colon-space-after',
|
|
113
|
+
'declaration-colon-space-before',
|
|
114
|
+
'function-comma-newline-after',
|
|
115
|
+
'function-comma-newline-before',
|
|
116
|
+
'function-comma-space-after',
|
|
117
|
+
'function-comma-space-before',
|
|
118
|
+
'function-max-empty-lines',
|
|
119
|
+
'function-parentheses-newline-inside',
|
|
120
|
+
'function-parentheses-space-inside',
|
|
121
|
+
'function-whitespace-after',
|
|
122
|
+
'indentation',
|
|
123
|
+
'linebreaks',
|
|
124
|
+
'max-empty-lines',
|
|
125
|
+
'max-line-length',
|
|
126
|
+
'media-feature-colon-space-after',
|
|
127
|
+
'media-feature-colon-space-before',
|
|
128
|
+
'media-feature-name-case',
|
|
129
|
+
'media-feature-parentheses-space-inside',
|
|
130
|
+
'media-feature-range-operator-space-after',
|
|
131
|
+
'media-feature-range-operator-space-before',
|
|
132
|
+
'media-query-list-comma-newline-after',
|
|
133
|
+
'media-query-list-comma-newline-before',
|
|
134
|
+
'media-query-list-comma-space-after',
|
|
135
|
+
'media-query-list-comma-space-before',
|
|
136
|
+
'no-empty-first-line',
|
|
137
|
+
'no-eol-whitespace',
|
|
138
|
+
'no-extra-semicolons',
|
|
139
|
+
'no-missing-end-of-source-newline',
|
|
140
|
+
'number-leading-zero',
|
|
141
|
+
'number-no-trailing-zeros',
|
|
142
|
+
'property-case',
|
|
143
|
+
'selector-attribute-brackets-space-inside',
|
|
144
|
+
'selector-attribute-operator-space-after',
|
|
145
|
+
'selector-attribute-operator-space-before',
|
|
146
|
+
'selector-combinator-space-after',
|
|
147
|
+
'selector-combinator-space-before',
|
|
148
|
+
'selector-descendant-combinator-no-non-space',
|
|
149
|
+
'selector-list-comma-newline-after',
|
|
150
|
+
'selector-list-comma-newline-before',
|
|
151
|
+
'selector-list-comma-space-after',
|
|
152
|
+
'selector-list-comma-space-before',
|
|
153
|
+
'selector-max-empty-lines',
|
|
154
|
+
'selector-pseudo-class-case',
|
|
155
|
+
'selector-pseudo-class-parentheses-space-inside',
|
|
156
|
+
'selector-pseudo-element-case',
|
|
157
|
+
'string-quotes',
|
|
158
|
+
'unicode-bom',
|
|
159
|
+
'unit-case',
|
|
160
|
+
'value-list-comma-newline-after',
|
|
161
|
+
'value-list-comma-newline-before',
|
|
162
|
+
'value-list-comma-space-after',
|
|
163
|
+
'value-list-comma-space-before',
|
|
164
|
+
'value-list-max-empty-lines'
|
|
165
|
+
].map((ruleName) => {
|
|
166
|
+
// eslint-disable-next-line import/no-dynamic-require -- Dynamic require reduces code complexity
|
|
167
|
+
const rule = require(`stylelint/lib/rules/${ruleName}`);
|
|
168
|
+
|
|
169
|
+
const forkedRule = Object.assign(
|
|
170
|
+
/**
|
|
171
|
+
* Wrapper for the original rule, to be able to manipulate the additional properties.
|
|
172
|
+
*
|
|
173
|
+
* @param {Parameters<import('stylelint').RuleBase>} args - The arguments of the rule function
|
|
174
|
+
* @returns {ReturnType<import('stylelint').RuleBase>} The return value of the rule function
|
|
175
|
+
*/
|
|
176
|
+
(...args) => rule(...args),
|
|
177
|
+
rule
|
|
178
|
+
);
|
|
179
|
+
|
|
180
|
+
forkedRule.ruleName = `plugin/${ruleName}`;
|
|
181
|
+
forkedRule.meta = {
|
|
182
|
+
...rule.meta,
|
|
183
|
+
deprecated: false
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
return stylelint.createPlugin(`plugin/${ruleName}`, forkedRule);
|
|
187
|
+
});
|
|
@@ -15,7 +15,7 @@ void (async () => {
|
|
|
15
15
|
|
|
16
16
|
const tempFilePath = path.join(folder, 'tmp.scss');
|
|
17
17
|
|
|
18
|
-
fs.writeFileSync(tempFilePath, '* {\n\tborder: 1px solid var(--color);\n\n\tcolor: var(--color);\n}\n', 'utf8');
|
|
18
|
+
fs.writeFileSync(tempFilePath, '@property --color {\n\tsyntax: "<color>";\n\tinherits: false;\n\tinitial-value: #f00; // stylelint-disable-line color-no-hex -- The initial value must be a hex-color\n}\n\n* {\n\tborder: 1px solid var(--color);\n\n\tcolor: var(--color);\n}\n', 'utf8');
|
|
19
19
|
|
|
20
20
|
const result = await runProcess(`stylelint -f json "${tempFilePath}"`);
|
|
21
21
|
|
|
@@ -35,7 +35,7 @@ void (async () => {
|
|
|
35
35
|
const { invalidOptionWarnings, warnings } = JSON.parse(result.stdout)[0];
|
|
36
36
|
|
|
37
37
|
if (warnings.length > 0) {
|
|
38
|
-
process.stderr.write(warnings.join('\n'));
|
|
38
|
+
process.stderr.write(`Warnings:\n\n- ${warnings.map(({ text }) => text).join('\n- ')}\n`);
|
|
39
39
|
|
|
40
40
|
process.exitCode = 1;
|
|
41
41
|
|
|
@@ -43,7 +43,7 @@ void (async () => {
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
if (invalidOptionWarnings.length > 0) {
|
|
46
|
-
process.stderr.write(`Invalid stylelint configuration:\n\n- ${invalidOptionWarnings.map(({ text }) => text).join('\n- ')}`);
|
|
46
|
+
process.stderr.write(`Invalid stylelint configuration:\n\n- ${invalidOptionWarnings.map(({ text }) => text).join('\n- ')}\n`);
|
|
47
47
|
|
|
48
48
|
process.exitCode = 1;
|
|
49
49
|
|