linter-bundle 1.28.0 → 2.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 +189 -75
- package/README.md +12 -4
- package/eslint/index.js +20 -8
- package/eslint/overrides-gatsby.js +7 -0
- package/eslint/overrides-javascript.js +1 -1
- package/eslint/overrides-jest.js +26 -4
- package/eslint/overrides-jsdoc.js +2 -2
- package/eslint/overrides-react.js +6 -2
- package/lint.js +1 -1
- package/markdownlint/base.json +3 -3
- package/package.json +27 -29
- package/stylelint/index.js +59 -48
- package/stylelint/plugins/stylelint-high-performance-animation.js +273 -0
- package/stylelint/plugins/stylelint-selector-tag-no-without-class.js +111 -0
- package/stylelint/processors/filter.js +0 -67
package/eslint/index.js
CHANGED
|
@@ -137,6 +137,7 @@ module.exports = {
|
|
|
137
137
|
'no-unsafe-finally': 'error',
|
|
138
138
|
'no-unsafe-negation': 'error',
|
|
139
139
|
'no-unsafe-optional-chaining': 'error',
|
|
140
|
+
'no-unused-private-class-members': 'error',
|
|
140
141
|
'no-useless-backreference': 'error',
|
|
141
142
|
'require-atomic-updates': 'error',
|
|
142
143
|
'use-isnan': 'error',
|
|
@@ -420,6 +421,7 @@ module.exports = {
|
|
|
420
421
|
'@typescript-eslint/consistent-indexed-object-style': 'error',
|
|
421
422
|
'@typescript-eslint/consistent-type-assertions': 'error',
|
|
422
423
|
'@typescript-eslint/consistent-type-definitions': 'error',
|
|
424
|
+
'@typescript-eslint/consistent-type-exports': 'error',
|
|
423
425
|
'@typescript-eslint/consistent-type-imports': ['error', { disallowTypeAnnotations: false }],
|
|
424
426
|
'@typescript-eslint/dot-notation': 'error',
|
|
425
427
|
'@typescript-eslint/explicit-function-return-type': 'off', // @todo Disabled till we can specify exceptions (React-default class methods, like render())
|
|
@@ -640,7 +642,10 @@ module.exports = {
|
|
|
640
642
|
'@typescript-eslint/no-require-imports': 'error',
|
|
641
643
|
'@typescript-eslint/no-shadow': 'error',
|
|
642
644
|
'@typescript-eslint/no-this-alias': 'error',
|
|
643
|
-
'@typescript-eslint/no-throw-literal': 'error',
|
|
645
|
+
'@typescript-eslint/no-throw-literal': ['error', {
|
|
646
|
+
allowThrowingAny: false,
|
|
647
|
+
allowThrowingUnknown: true
|
|
648
|
+
}],
|
|
644
649
|
'@typescript-eslint/no-type-alias': ['off', { // @todo There should be an option like 'sub-in-unions-and-intersections', which allows `type A = (string | number)[];`
|
|
645
650
|
allowAliases: 'always',
|
|
646
651
|
allowCallbacks: 'always',
|
|
@@ -662,7 +667,6 @@ module.exports = {
|
|
|
662
667
|
'@typescript-eslint/no-unsafe-member-access': 'error',
|
|
663
668
|
'@typescript-eslint/no-unsafe-return': 'error',
|
|
664
669
|
'@typescript-eslint/no-unused-expressions': 'error',
|
|
665
|
-
'@typescript-eslint/no-unused-vars-experimental': 'error',
|
|
666
670
|
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
|
|
667
671
|
'@typescript-eslint/no-use-before-define': ['error', { functions: false }],
|
|
668
672
|
'@typescript-eslint/no-useless-constructor': 'error',
|
|
@@ -732,7 +736,6 @@ module.exports = {
|
|
|
732
736
|
'functional/no-try-statement': 'off',
|
|
733
737
|
'functional/prefer-readonly-type': ['error', { ignoreClass: true, allowLocalMutation: true, ignoreCollections: true, ignoreInterface: true }],
|
|
734
738
|
'functional/prefer-tacit': 'off', // @see https://github.com/jonaskello/eslint-plugin-functional/issues/263
|
|
735
|
-
'functional/prefer-type-literal': 'off', // Deprecated in favor of @typescript-eslint/consistent-type-definitions
|
|
736
739
|
|
|
737
740
|
/**
|
|
738
741
|
* eslint-plugin-import
|
|
@@ -767,7 +770,7 @@ module.exports = {
|
|
|
767
770
|
'workbox-window/utils/WorkboxEvent'
|
|
768
771
|
]
|
|
769
772
|
}],
|
|
770
|
-
'import/no-import-module-exports': 'off', //
|
|
773
|
+
'import/no-import-module-exports': 'off', // Activated only for JavaScript files
|
|
771
774
|
'import/no-mutable-exports': 'error',
|
|
772
775
|
'import/no-named-as-default-member': 'error',
|
|
773
776
|
'import/no-named-as-default': 'error',
|
|
@@ -785,7 +788,7 @@ module.exports = {
|
|
|
785
788
|
'jest-extended'
|
|
786
789
|
]
|
|
787
790
|
}],
|
|
788
|
-
'import/no-unresolved': 'error',
|
|
791
|
+
'import/no-unresolved': ['error', { caseSensitiveStrict: true }],
|
|
789
792
|
'import/no-unused-modules': 'error',
|
|
790
793
|
'import/no-useless-path-segments': 'error',
|
|
791
794
|
'import/no-webpack-loader-syntax': 'off', // Indeed, you should avoid that, but if we do it, we have a reason for it
|
|
@@ -912,13 +915,15 @@ module.exports = {
|
|
|
912
915
|
'unicorn/import-style': 'error',
|
|
913
916
|
'unicorn/new-for-builtins': 'error',
|
|
914
917
|
'unicorn/no-abusive-eslint-disable': 'error',
|
|
915
|
-
'unicorn/no-array-callback-reference': 'off', // If I use functions, they are
|
|
918
|
+
'unicorn/no-array-callback-reference': 'off', // If I use functions, they are the best option for this use-case
|
|
916
919
|
'unicorn/no-array-for-each': 'error',
|
|
917
920
|
'unicorn/no-array-method-this-argument': 'error',
|
|
918
921
|
'unicorn/no-array-push-push': 'error',
|
|
919
922
|
'unicorn/no-array-reduce': ['error', { allowSimpleOperations: true }],
|
|
923
|
+
'unicorn/no-await-expression-member': 'error',
|
|
920
924
|
'unicorn/no-console-spaces': 'error',
|
|
921
925
|
'unicorn/no-document-cookie': 'error',
|
|
926
|
+
'unicorn/no-empty-file': 'error',
|
|
922
927
|
'unicorn/no-for-loop': 'off', // @typescript-eslint/prefer-for-of
|
|
923
928
|
'unicorn/no-hex-escape': 'error',
|
|
924
929
|
'unicorn/no-instanceof-array': 'error',
|
|
@@ -931,11 +936,13 @@ module.exports = {
|
|
|
931
936
|
'unicorn/no-object-as-default-parameter': 'error',
|
|
932
937
|
'unicorn/no-process-exit': 'error',
|
|
933
938
|
'unicorn/no-static-only-class': 'error',
|
|
939
|
+
'unicorn/no-thenable': 'error',
|
|
934
940
|
'unicorn/no-this-assignment': 'error',
|
|
935
941
|
'unicorn/no-unreadable-array-destructuring': 'error',
|
|
936
942
|
'unicorn/no-unsafe-regex': 'off',
|
|
937
943
|
'unicorn/no-unused-properties': 'error',
|
|
938
944
|
'unicorn/no-useless-fallback-in-spread': 'error',
|
|
945
|
+
'unicorn/no-useless-promise-resolve-reject': 'error',
|
|
939
946
|
'unicorn/no-invalid-remove-event-listener': 'error',
|
|
940
947
|
'unicorn/no-useless-length-check': 'error',
|
|
941
948
|
'unicorn/no-useless-spread': 'error',
|
|
@@ -950,20 +957,23 @@ module.exports = {
|
|
|
950
957
|
'unicorn/prefer-array-index-of': 'error',
|
|
951
958
|
'unicorn/prefer-array-some': 'error',
|
|
952
959
|
'unicorn/prefer-at': 'off', // @todo Disabled for now, since `at` is not supported by TypeScript type definitions yet.
|
|
960
|
+
'unicorn/prefer-code-point': 'error',
|
|
953
961
|
'unicorn/prefer-date-now': 'error',
|
|
954
962
|
'unicorn/prefer-default-parameters': 'error',
|
|
955
963
|
'unicorn/prefer-dom-node-append': 'error',
|
|
956
964
|
'unicorn/prefer-dom-node-dataset': 'off', // `setAttribute` is faster than `dataset`. See https://www.measurethat.net/Benchmarks/Show/7740/0/classname-vs-setattribute-vs-classlist-vs-dataset
|
|
957
965
|
'unicorn/prefer-dom-node-remove': 'error',
|
|
958
966
|
'unicorn/prefer-dom-node-text-content': 'error',
|
|
967
|
+
'unicorn/prefer-export-from': 'error',
|
|
959
968
|
'unicorn/prefer-includes': 'error',
|
|
969
|
+
'unicorn/prefer-json-parse-buffer': 'error',
|
|
960
970
|
'unicorn/prefer-keyboard-event-key': 'error',
|
|
961
971
|
'unicorn/prefer-math-trunc': 'error',
|
|
962
972
|
'unicorn/prefer-modern-dom-apis': 'error',
|
|
963
973
|
'unicorn/prefer-module': 'off',
|
|
964
974
|
'unicorn/prefer-negative-index': 'error',
|
|
965
975
|
'unicorn/prefer-number-properties': 'error',
|
|
966
|
-
'unicorn/prefer-object-has-own': '
|
|
976
|
+
'unicorn/prefer-object-has-own': 'off', // Not widely supported yet. Can be activated in 2024
|
|
967
977
|
'unicorn/prefer-object-from-entries': 'error',
|
|
968
978
|
'unicorn/prefer-optional-catch-binding': 'error',
|
|
969
979
|
'unicorn/prefer-prototype-methods': 'error',
|
|
@@ -977,10 +987,11 @@ module.exports = {
|
|
|
977
987
|
'unicorn/prefer-string-trim-start-end': 'error',
|
|
978
988
|
'unicorn/prefer-switch': 'error',
|
|
979
989
|
'unicorn/prefer-ternary': 'off', // We prefer readability over saving a few chars
|
|
980
|
-
'unicorn/prefer-top-level-await': '
|
|
990
|
+
'unicorn/prefer-top-level-await': 'off', // @todo There should be a detection that this option is only activated on Node.js v14.8 environments and above (Check for "engine" property in package.json, and "node -v")
|
|
981
991
|
'unicorn/prefer-regexp-test': 'error',
|
|
982
992
|
'unicorn/prefer-type-error': 'error',
|
|
983
993
|
'unicorn/prevent-abbreviations': ['error', { ignore: ['args', 'i', 'j', 'i18n', 'ref', 'Ref', 'params', 'props', 'Props'] }],
|
|
994
|
+
'unicorn/relative-url-style': 'error',
|
|
984
995
|
'unicorn/require-array-join-separator': 'error',
|
|
985
996
|
'unicorn/require-number-to-fixed-digits-argument': 'error',
|
|
986
997
|
'unicorn/require-post-message-target-origin': 'off', // False-positive with Workers which don't support a `targetOrigin`
|
|
@@ -991,6 +1002,7 @@ module.exports = {
|
|
|
991
1002
|
'->': '→'
|
|
992
1003
|
}
|
|
993
1004
|
}],
|
|
1005
|
+
'unicorn/template-indent': 'error',
|
|
994
1006
|
'unicorn/throw-new-error': 'error'
|
|
995
1007
|
}
|
|
996
1008
|
};
|
|
@@ -33,6 +33,13 @@ module.exports = {
|
|
|
33
33
|
*/
|
|
34
34
|
'@typescript-eslint/no-confusing-void-expression': 'off', // @todo Conflicts with graphql-template strings
|
|
35
35
|
|
|
36
|
+
/**
|
|
37
|
+
* eslint-plugin-import
|
|
38
|
+
*
|
|
39
|
+
* @see https://github.com/import-js/eslint-plugin-import
|
|
40
|
+
*/
|
|
41
|
+
'import/no-unresolved': ['error', { caseSensitiveStrict: true, ignore: ['@reach/router'] }],
|
|
42
|
+
|
|
36
43
|
/**
|
|
37
44
|
* eslint-plugin-unicorn
|
|
38
45
|
*
|
|
@@ -31,7 +31,6 @@ module.exports = {
|
|
|
31
31
|
'@typescript-eslint/no-implicit-any-catch': 'off', // @todo What's the correct way to define the type of the error-parameter in js files?
|
|
32
32
|
'@typescript-eslint/no-require-imports': 'off', // Requires type information
|
|
33
33
|
'@typescript-eslint/no-unsafe-assignment': 'off', // @todo Reactivate after bug in @typescript-eslint is fixed (@see https://github.com/typescript-eslint/typescript-eslint/issues/1943)
|
|
34
|
-
'@typescript-eslint/no-unused-vars-experimental': 'off', // @todo Throws an error "Maximum call stack size exceeded."
|
|
35
34
|
'@typescript-eslint/no-var-requires': 'off', // Requires type information
|
|
36
35
|
'@typescript-eslint/prefer-nullish-coalescing': 'off', // @todo `??` is not yet supported by NodeJS. Remove this like, as soon as it is supported.
|
|
37
36
|
'@typescript-eslint/prefer-optional-chain': 'off', // @todo `?.` is not yet supported by NodeJS. Remove this like, as soon as it is supported.
|
|
@@ -43,6 +42,7 @@ module.exports = {
|
|
|
43
42
|
* @see https://github.com/import-js/eslint-plugin-import
|
|
44
43
|
*/
|
|
45
44
|
'import/no-commonjs': 'off',
|
|
45
|
+
'import/no-import-module-exports': 'error',
|
|
46
46
|
'import/no-internal-modules': 'off',
|
|
47
47
|
'import/no-nodejs-modules': 'off',
|
|
48
48
|
|
package/eslint/overrides-jest.js
CHANGED
|
@@ -9,6 +9,25 @@ module.exports = {
|
|
|
9
9
|
env: {
|
|
10
10
|
jest: true
|
|
11
11
|
},
|
|
12
|
+
settings: {
|
|
13
|
+
jest: {
|
|
14
|
+
version: (() => {
|
|
15
|
+
try {
|
|
16
|
+
// eslint-disable-next-line node/no-missing-require, import/no-dynamic-require -- If "overrides-jest" is used, "jest" should be installed, and it should be searched in the working directory of the process.
|
|
17
|
+
const jestVersion = require(require.resolve('jest', { paths: [process.cwd()] })).getVersion().split('.')[0];
|
|
18
|
+
|
|
19
|
+
process.stdout.write(`Detected Jest version: ${jestVersion}\n\n`);
|
|
20
|
+
|
|
21
|
+
return jestVersion;
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
process.stderr.write('No Jest version detected\n\n');
|
|
25
|
+
|
|
26
|
+
return 'detect';
|
|
27
|
+
}
|
|
28
|
+
})()
|
|
29
|
+
}
|
|
30
|
+
},
|
|
12
31
|
plugins: ['jest'],
|
|
13
32
|
rules: {
|
|
14
33
|
/**
|
|
@@ -42,7 +61,7 @@ module.exports = {
|
|
|
42
61
|
*/
|
|
43
62
|
'jest/consistent-test-it': 'error',
|
|
44
63
|
'jest/expect-expect': 'error',
|
|
45
|
-
'jest/lowercase-
|
|
64
|
+
'jest/prefer-lowercase-title': ['error', { ignore: ['describe'] }],
|
|
46
65
|
'jest/max-nested-describe': 'error',
|
|
47
66
|
'jest/no-alias-methods': 'error',
|
|
48
67
|
'jest/no-commented-out-tests': 'error',
|
|
@@ -66,11 +85,14 @@ module.exports = {
|
|
|
66
85
|
'jest/no-test-return-statement': 'error',
|
|
67
86
|
'jest/prefer-called-with': 'error',
|
|
68
87
|
'jest/prefer-expect-assertions': ['error', { onlyFunctionsWithAsyncKeyword: true }],
|
|
88
|
+
'jest/prefer-expect-resolves': 'off', // We prefer `expect(await promise)` enforced by 'jest/no-restricted-matchers'
|
|
69
89
|
'jest/prefer-hooks-on-top': 'error',
|
|
90
|
+
'jest/require-hook': 'error',
|
|
91
|
+
'jest/prefer-comparison-matcher': 'error',
|
|
92
|
+
'jest/prefer-equality-matcher': 'error',
|
|
70
93
|
'jest/prefer-spy-on': 'error',
|
|
71
94
|
'jest/prefer-strict-equal': 'error',
|
|
72
|
-
'jest/prefer-to-be
|
|
73
|
-
'jest/prefer-to-be-undefined': 'error',
|
|
95
|
+
'jest/prefer-to-be': 'error',
|
|
74
96
|
'jest/prefer-to-contain': 'error',
|
|
75
97
|
'jest/prefer-to-have-length': 'error',
|
|
76
98
|
'jest/prefer-todo': 'error',
|
|
@@ -84,7 +106,7 @@ module.exports = {
|
|
|
84
106
|
'jest/require-top-level-describe': 'error',
|
|
85
107
|
'jest/require-to-throw-message': 'error',
|
|
86
108
|
'jest/unbound-method': 'error',
|
|
87
|
-
'jest/valid-describe': 'error',
|
|
109
|
+
'jest/valid-describe-callback': 'error',
|
|
88
110
|
'jest/valid-expect-in-promise': 'error',
|
|
89
111
|
'jest/valid-expect': 'error',
|
|
90
112
|
'jest/valid-title': 'error'
|
|
@@ -24,8 +24,8 @@ module.exports = {
|
|
|
24
24
|
*/
|
|
25
25
|
'jsdoc/check-access': 'error',
|
|
26
26
|
'jsdoc/check-alignment': 'error',
|
|
27
|
-
'jsdoc/check-examples': 'off', // @todo
|
|
28
|
-
'jsdoc/check-indentation': ['off', { excludeTags: ['typedef'] }], // @todo
|
|
27
|
+
'jsdoc/check-examples': 'off', // @todo Need to be configured to allow text-based examples
|
|
28
|
+
'jsdoc/check-indentation': ['off', { excludeTags: ['typedef'] }], // @todo Why is this disabled?
|
|
29
29
|
'jsdoc/check-param-names': 'error',
|
|
30
30
|
'jsdoc/check-syntax': 'error',
|
|
31
31
|
'jsdoc/check-line-alignment': 'error',
|
|
@@ -55,6 +55,7 @@ module.exports = {
|
|
|
55
55
|
}],
|
|
56
56
|
'react/no-access-state-in-setstate': 'error',
|
|
57
57
|
'react/no-array-index-key': 'error',
|
|
58
|
+
'react/no-arrow-function-lifecycle': 'error',
|
|
58
59
|
'react/no-children-prop': 'error',
|
|
59
60
|
'react/no-danger': 'off',
|
|
60
61
|
'react/no-danger-with-children': 'error',
|
|
@@ -63,8 +64,10 @@ module.exports = {
|
|
|
63
64
|
'react/no-did-update-set-state': 'error',
|
|
64
65
|
'react/no-direct-mutation-state': 'error',
|
|
65
66
|
'react/no-find-dom-node': 'error',
|
|
67
|
+
'react/no-invalid-html-attribute': 'error',
|
|
66
68
|
'react/no-is-mounted': 'error',
|
|
67
69
|
'react/no-multi-comp': 'error',
|
|
70
|
+
'react/no-namespace': 'error',
|
|
68
71
|
'react/no-redundant-should-component-update': 'error',
|
|
69
72
|
'react/no-render-return-value': 'error',
|
|
70
73
|
'react/no-set-state': 'off',
|
|
@@ -75,6 +78,7 @@ module.exports = {
|
|
|
75
78
|
'react/no-unknown-property': 'error',
|
|
76
79
|
'react/no-unsafe': 'error',
|
|
77
80
|
'react/no-unstable-nested-components': 'error',
|
|
81
|
+
'react/no-unused-class-component-methods': 'error',
|
|
78
82
|
'react/no-unused-prop-types': 'error',
|
|
79
83
|
'react/no-unused-state': 'error',
|
|
80
84
|
'react/no-will-update-set-state': 'error',
|
|
@@ -84,7 +88,7 @@ module.exports = {
|
|
|
84
88
|
'react/prefer-stateless-function': 'error',
|
|
85
89
|
'react/prop-types': 'off',
|
|
86
90
|
'react/react-in-jsx-scope': 'error',
|
|
87
|
-
'react/require-default-props': ['
|
|
91
|
+
'react/require-default-props': ['off', { forbidDefaultForRequired: true, ignoreFunctionalComponents: true }], // @see https://medium.com/@matanbobi/react-defaultprops-is-dying-whos-the-contender-443c19d9e7f1 @todo Also disabled becaues of false-positive with React.forwardRef(), create bug report?
|
|
88
92
|
'react/require-optimization': 'error',
|
|
89
93
|
'react/require-render-return': 'error',
|
|
90
94
|
'react/self-closing-comp': 'error',
|
|
@@ -125,7 +129,7 @@ module.exports = {
|
|
|
125
129
|
'react/jsx-indent-props': ['error', 'tab'],
|
|
126
130
|
'react/jsx-key': ['error', { checkKeyMustBeforeSpread: true }],
|
|
127
131
|
'react/jsx-max-depth': ['error', { max: 8 }],
|
|
128
|
-
'react/jsx-max-props-per-line': ['error', { maximum: 5,
|
|
132
|
+
'react/jsx-max-props-per-line': ['error', { maximum: { single: 5, multi: 1 } }],
|
|
129
133
|
'react/no-adjacent-inline-elements': 'off', // @todo There is an issue if inline and block elements are mixed. Simple example: `<span>Text</span><br />` here, the space between the SPAN and BR should not be forced, because a space at the end of a line does not make sense.
|
|
130
134
|
'react/jsx-newline': 'off',
|
|
131
135
|
'react/jsx-no-bind': ['error', { ignoreDOMComponents: true }],
|
package/lint.js
CHANGED
|
@@ -32,7 +32,7 @@ const jobs = getTasksToRun(process.argv.splice(2)).map(({ taskName, config }) =>
|
|
|
32
32
|
taskName,
|
|
33
33
|
command: [
|
|
34
34
|
'node',
|
|
35
|
-
`"${require.resolve('eslint
|
|
35
|
+
`"${path.join(path.dirname(require.resolve('eslint')), '../bin/eslint.js')}"`,
|
|
36
36
|
config['include']?.[0] ?? '"./**/*.{js,jsx,ts,tsx}"',
|
|
37
37
|
config['exclude']?.map((exclude) => `--ignore-pattern ${exclude}`).join(' '),
|
|
38
38
|
`--rulesdir "${path.resolve(__dirname, './eslint/rules/')}"`,
|
package/markdownlint/base.json
CHANGED
|
@@ -6,6 +6,9 @@
|
|
|
6
6
|
"code_block_line_length": 300,
|
|
7
7
|
"tables": false
|
|
8
8
|
},
|
|
9
|
+
"MD024": {
|
|
10
|
+
"siblings_only": true
|
|
11
|
+
},
|
|
9
12
|
"MD026": {
|
|
10
13
|
"punctuation": ".,;:!。,;:!"
|
|
11
14
|
},
|
|
@@ -14,8 +17,5 @@
|
|
|
14
17
|
"span"
|
|
15
18
|
]
|
|
16
19
|
},
|
|
17
|
-
"MD024": {
|
|
18
|
-
"siblings_only": true
|
|
19
|
-
},
|
|
20
20
|
"MD046": false
|
|
21
21
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "linter-bundle",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.3.1",
|
|
4
4
|
"description": "Ready-to use bundle of linting tools, containing configurations for ESLint, stylelint and markdownlint.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -39,41 +39,39 @@
|
|
|
39
39
|
"check-outdated": "npx --yes -- check-outdated --ignore-pre-releases"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@typescript-eslint/eslint-plugin": "
|
|
43
|
-
"@typescript-eslint/parser": "
|
|
44
|
-
"eslint": "7.
|
|
42
|
+
"@typescript-eslint/eslint-plugin": "5.10.1",
|
|
43
|
+
"@typescript-eslint/parser": "5.10.1",
|
|
44
|
+
"eslint": "8.7.0",
|
|
45
45
|
"eslint-import-resolver-typescript": "2.5.0",
|
|
46
|
-
"eslint-import-resolver-webpack": "0.13.
|
|
46
|
+
"eslint-import-resolver-webpack": "0.13.2",
|
|
47
47
|
"eslint-plugin-eslint-comments": "3.2.0",
|
|
48
|
-
"eslint-plugin-functional": "
|
|
49
|
-
"eslint-plugin-import": "2.
|
|
50
|
-
"eslint-plugin-jest": "
|
|
51
|
-
"eslint-plugin-jsdoc": "
|
|
52
|
-
"eslint-plugin-jsx-a11y": "6.
|
|
48
|
+
"eslint-plugin-functional": "4.1.1",
|
|
49
|
+
"eslint-plugin-import": "2.25.4",
|
|
50
|
+
"eslint-plugin-jest": "26.0.0",
|
|
51
|
+
"eslint-plugin-jsdoc": "37.7.0",
|
|
52
|
+
"eslint-plugin-jsx-a11y": "6.5.1",
|
|
53
53
|
"eslint-plugin-node": "11.1.0",
|
|
54
|
-
"eslint-plugin-promise": "
|
|
55
|
-
"eslint-plugin-react": "7.
|
|
56
|
-
"eslint-plugin-react-hooks": "4.
|
|
57
|
-
"eslint-plugin-unicorn": "
|
|
58
|
-
"markdownlint-cli": "0.
|
|
59
|
-
"
|
|
60
|
-
"stylelint
|
|
61
|
-
"stylelint-
|
|
62
|
-
"stylelint-order": "
|
|
63
|
-
"stylelint-scss": "
|
|
54
|
+
"eslint-plugin-promise": "6.0.0",
|
|
55
|
+
"eslint-plugin-react": "7.28.0",
|
|
56
|
+
"eslint-plugin-react-hooks": "4.3.0",
|
|
57
|
+
"eslint-plugin-unicorn": "40.1.0",
|
|
58
|
+
"markdownlint-cli": "0.30.0",
|
|
59
|
+
"postcss-scss": "4.0.3",
|
|
60
|
+
"stylelint": "14.3.0",
|
|
61
|
+
"stylelint-declaration-block-no-ignored-properties": "2.5.0",
|
|
62
|
+
"stylelint-order": "5.0.0",
|
|
63
|
+
"stylelint-scss": "4.1.0",
|
|
64
64
|
"stylelint-selector-no-empty": "1.0.8",
|
|
65
|
-
"stylelint-
|
|
66
|
-
"stylelint-use-logical-spec": "3.2.2",
|
|
67
|
-
"stylelint-use-nesting": "3.0.0"
|
|
65
|
+
"stylelint-use-logical-spec": "3.2.2"
|
|
68
66
|
},
|
|
69
67
|
"peerDependencies": {
|
|
70
|
-
"typescript": "^4.0.0"
|
|
68
|
+
"typescript": "^4.0.0",
|
|
69
|
+
"postcss-value-parser": "*"
|
|
71
70
|
},
|
|
72
71
|
"devDependencies": {
|
|
73
|
-
"@types/eslint": "
|
|
74
|
-
"@types/node": "
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"typescript": "4.4.3"
|
|
72
|
+
"@types/eslint": "8.4.1",
|
|
73
|
+
"@types/node": "17.0.13",
|
|
74
|
+
"stylelint-find-new-rules": "^3.0.4",
|
|
75
|
+
"typescript": "4.5.5"
|
|
78
76
|
}
|
|
79
77
|
}
|
package/stylelint/index.js
CHANGED
|
@@ -4,30 +4,62 @@
|
|
|
4
4
|
|
|
5
5
|
/* eslint-disable max-lines -- The rules can be easier managed if they are all in one file */
|
|
6
6
|
|
|
7
|
+
const path = require('path');
|
|
8
|
+
|
|
7
9
|
module.exports = {
|
|
8
10
|
reportNeedlessDisables: true,
|
|
9
11
|
reportInvalidScopeDisables: true,
|
|
10
12
|
reportDescriptionlessDisables: true,
|
|
13
|
+
customSyntax: 'postcss-scss',
|
|
11
14
|
plugins: [
|
|
12
15
|
'stylelint-declaration-block-no-ignored-properties',
|
|
13
|
-
'stylelint-high-performance-animation',
|
|
14
16
|
'stylelint-order',
|
|
15
17
|
'stylelint-scss',
|
|
16
18
|
'stylelint-selector-no-empty',
|
|
17
|
-
'stylelint-selector-tag-no-without-class',
|
|
18
19
|
'stylelint-use-logical-spec',
|
|
19
|
-
'stylelint-
|
|
20
|
+
path.join(__dirname, '/plugins/stylelint-high-performance-animation.js'),
|
|
21
|
+
path.join(__dirname, '/plugins/stylelint-selector-tag-no-without-class.js')
|
|
20
22
|
],
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
overrides: [
|
|
24
|
+
{
|
|
25
|
+
files: ['**/*.module.*'],
|
|
26
|
+
rules: {
|
|
27
|
+
/**
|
|
28
|
+
* stylelint
|
|
29
|
+
*
|
|
30
|
+
* @see https://github.com/stylelint/stylelint/tree/master/lib/rules
|
|
31
|
+
*/
|
|
32
|
+
'selector-class-pattern': `^(?!(${[
|
|
33
|
+
// Disallowed reserved JavaScript keywords
|
|
34
|
+
'abstract',
|
|
35
|
+
'arguments', 'await',
|
|
36
|
+
'boolean', 'break', 'byte',
|
|
37
|
+
'case', 'catch', 'char', 'class', 'const', 'continue',
|
|
38
|
+
'debugger', 'default', 'delete', 'do', 'double',
|
|
39
|
+
'else', 'enum', 'eval', 'export', 'extends',
|
|
40
|
+
'false', 'final', 'finally', 'float', 'for', 'function',
|
|
41
|
+
'goto',
|
|
42
|
+
'if', 'implements', 'import', 'in', 'Infinity', 'instanceof', 'int', 'interface',
|
|
43
|
+
'let', 'long',
|
|
44
|
+
'NaN', 'native', 'new', 'null',
|
|
45
|
+
'package', 'private', 'protected', 'public',
|
|
46
|
+
'return',
|
|
47
|
+
'short', 'static', 'super', 'switch', 'synchronized',
|
|
48
|
+
'this', 'throw', 'throws', 'transient', 'true', 'try', 'typeof',
|
|
49
|
+
'undefined',
|
|
50
|
+
'var', 'void', 'volatile',
|
|
51
|
+
'while', 'with',
|
|
52
|
+
'yield'
|
|
53
|
+
].join('|')})$).+`,
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* stylelint-selector-tag-no-without-class
|
|
57
|
+
*
|
|
58
|
+
* @see https://github.com/Moxio/stylelint-selector-tag-no-without-class
|
|
59
|
+
*/
|
|
60
|
+
'plugin/selector-tag-no-without-class': ['/./']
|
|
29
61
|
}
|
|
30
|
-
|
|
62
|
+
}
|
|
31
63
|
],
|
|
32
64
|
rules: {
|
|
33
65
|
/**
|
|
@@ -71,6 +103,7 @@ module.exports = {
|
|
|
71
103
|
'block-opening-brace-space-after': 'always-single-line',
|
|
72
104
|
'block-opening-brace-space-before': 'always',
|
|
73
105
|
'color-function-notation': null, // @todo Doesn't work with variables like: hsl(var(--xyz)). Create issue. Later change that to 'modern'.
|
|
106
|
+
'color-hex-alpha': null, // @todo Not widely supported yet. Activate in 2024.
|
|
74
107
|
'color-hex-case': 'lower',
|
|
75
108
|
'color-hex-length': 'short',
|
|
76
109
|
'color-named': 'never',
|
|
@@ -89,6 +122,7 @@ module.exports = {
|
|
|
89
122
|
'comment-word-disallowed-list': null,
|
|
90
123
|
'custom-media-pattern': (global.linterBundleSettings?.patternPrefix ? `${global.linterBundleSettings.patternPrefix}-[a-z][a-zA-Z]+(-[a-z][a-zA-Z]+\\d*)+` : null),
|
|
91
124
|
'custom-property-empty-line-before': null, // Empty lines between custom properties are optional
|
|
125
|
+
'custom-property-no-missing-var-function': true,
|
|
92
126
|
'custom-property-pattern': (global.linterBundleSettings?.patternPrefix ? `${global.linterBundleSettings.patternPrefix}-[a-z][a-zA-Z]+(-[a-z][a-zA-Z]+\\d*)*` : null),
|
|
93
127
|
'declaration-bang-space-after': 'never',
|
|
94
128
|
'declaration-bang-space-before': 'always',
|
|
@@ -140,7 +174,6 @@ module.exports = {
|
|
|
140
174
|
'font-family-no-missing-generic-family-keyword': true,
|
|
141
175
|
'font-weight-notation': 'numeric',
|
|
142
176
|
'function-allowed-list': null,
|
|
143
|
-
'function-calc-no-invalid': true,
|
|
144
177
|
'function-calc-no-unspaced-operator': true,
|
|
145
178
|
'function-comma-newline-after': 'always-multi-line',
|
|
146
179
|
'function-comma-newline-before': 'never-multi-line',
|
|
@@ -171,9 +204,7 @@ module.exports = {
|
|
|
171
204
|
'media-feature-name-allowed-list': null,
|
|
172
205
|
'media-feature-name-case': 'lower',
|
|
173
206
|
'media-feature-name-disallowed-list': null,
|
|
174
|
-
'media-feature-name-no-unknown':
|
|
175
|
-
ignoreMediaFeatureNames: ['prefers-contrast']
|
|
176
|
-
}],
|
|
207
|
+
'media-feature-name-no-unknown': true,
|
|
177
208
|
'media-feature-name-no-vendor-prefix': null, // For Safari, we still need "-webkit-min-device-pixel-ratio": https://caniuse.com/css-media-resolution
|
|
178
209
|
'media-feature-name-value-allowed-list': null,
|
|
179
210
|
'media-feature-parentheses-space-inside': 'never',
|
|
@@ -212,6 +243,7 @@ module.exports = {
|
|
|
212
243
|
],
|
|
213
244
|
'property-no-unknown': true,
|
|
214
245
|
'property-no-vendor-prefix': true,
|
|
246
|
+
'rule-selector-property-disallowed-list': null,
|
|
215
247
|
'rule-empty-line-before': [
|
|
216
248
|
'always-multi-line',
|
|
217
249
|
{
|
|
@@ -226,28 +258,7 @@ module.exports = {
|
|
|
226
258
|
'selector-attribute-operator-space-after': 'never',
|
|
227
259
|
'selector-attribute-operator-space-before': 'never',
|
|
228
260
|
'selector-attribute-quotes': 'always',
|
|
229
|
-
'selector-class-pattern':
|
|
230
|
-
// Disallowed reserved JavaScript keywords
|
|
231
|
-
'abstract',
|
|
232
|
-
'arguments', 'await',
|
|
233
|
-
'boolean', 'break', 'byte',
|
|
234
|
-
'case', 'catch', 'char', 'class', 'const', 'continue',
|
|
235
|
-
'debugger', 'default', 'delete', 'do', 'double',
|
|
236
|
-
'else', 'enum', 'eval', 'export', 'extends',
|
|
237
|
-
'false', 'final', 'finally', 'float', 'for', 'function',
|
|
238
|
-
'goto',
|
|
239
|
-
'if', 'implements', 'import', 'in', 'Infinity', 'instanceof', 'int', 'interface',
|
|
240
|
-
'let', 'long',
|
|
241
|
-
'NaN', 'native', 'new', 'null',
|
|
242
|
-
'package', 'private', 'protected', 'public',
|
|
243
|
-
'return',
|
|
244
|
-
'short', 'static', 'super', 'switch', 'synchronized',
|
|
245
|
-
'this', 'throw', 'throws', 'transient', 'true', 'try', 'typeof',
|
|
246
|
-
'undefined',
|
|
247
|
-
'var', 'void', 'volatile',
|
|
248
|
-
'while', 'with',
|
|
249
|
-
'yield'
|
|
250
|
-
].join('|')})$).+`,
|
|
261
|
+
'selector-class-pattern': null,
|
|
251
262
|
'selector-combinator-allowed-list': null,
|
|
252
263
|
'selector-combinator-disallowed-list': null,
|
|
253
264
|
'selector-combinator-space-after': 'always',
|
|
@@ -298,7 +309,12 @@ module.exports = {
|
|
|
298
309
|
'unit-case': 'lower',
|
|
299
310
|
'unit-disallowed-list': null,
|
|
300
311
|
'unit-no-unknown': true,
|
|
301
|
-
'value-keyword-case':
|
|
312
|
+
'value-keyword-case': [
|
|
313
|
+
'lower',
|
|
314
|
+
{
|
|
315
|
+
camelCaseSvgKeywords: true
|
|
316
|
+
}
|
|
317
|
+
],
|
|
302
318
|
'value-list-comma-newline-after': 'always-multi-line',
|
|
303
319
|
'value-list-comma-newline-before': 'never-multi-line',
|
|
304
320
|
'value-list-comma-space-after': 'always-single-line',
|
|
@@ -837,6 +853,7 @@ module.exports = {
|
|
|
837
853
|
'scss/at-mixin-pattern': '^[a-z]+(-[a-z]+)*$',
|
|
838
854
|
'scss/at-rule-conditional-no-parentheses': true,
|
|
839
855
|
'scss/at-rule-no-unknown': true,
|
|
856
|
+
'scss/at-use-no-unnamespaced': true,
|
|
840
857
|
'scss/comment-no-empty': true,
|
|
841
858
|
'scss/comment-no-loud': true,
|
|
842
859
|
'scss/declaration-nested-properties-no-divided-groups': true,
|
|
@@ -860,6 +877,7 @@ module.exports = {
|
|
|
860
877
|
],
|
|
861
878
|
'scss/dollar-variable-first-in-block': [true, { ignore: ['comments', 'imports'] }],
|
|
862
879
|
'scss/dollar-variable-no-missing-interpolation': true,
|
|
880
|
+
'scss/dollar-variable-no-namespaced-assignment': true,
|
|
863
881
|
'scss/dollar-variable-pattern': '^[a-z]+(-[a-z]+)*$',
|
|
864
882
|
'scss/double-slash-comment-empty-line-before': [
|
|
865
883
|
'always',
|
|
@@ -900,7 +918,7 @@ module.exports = {
|
|
|
900
918
|
*
|
|
901
919
|
* @see https://github.com/Moxio/stylelint-selector-tag-no-without-class
|
|
902
920
|
*/
|
|
903
|
-
'plugin/selector-tag-no-without-class':
|
|
921
|
+
'plugin/selector-tag-no-without-class': null,
|
|
904
922
|
|
|
905
923
|
/**
|
|
906
924
|
* stylelint-use-logical-spec
|
|
@@ -945,13 +963,6 @@ module.exports = {
|
|
|
945
963
|
'min-height', // "min-block-size" is very rarely needed. I'm not aware of any use-case.
|
|
946
964
|
'max-width', // "max-inline-size" is very rarely needed. I'm not aware of any use-case.
|
|
947
965
|
'max-height' // "max-block-size" is very rarely needed. I'm not aware of any use-case.
|
|
948
|
-
] }]
|
|
949
|
-
|
|
950
|
-
/**
|
|
951
|
-
* stylelint-use-nesting
|
|
952
|
-
*
|
|
953
|
-
* @see https://github.com/csstools/stylelint-use-nesting
|
|
954
|
-
*/
|
|
955
|
-
'csstools/use-nesting': 'always'
|
|
966
|
+
] }]
|
|
956
967
|
}
|
|
957
968
|
};
|