linter-bundle 2.12.0 → 2.14.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 +58 -7
- package/eslint/index.js +7 -2
- package/eslint/overrides-jsdoc.js +1 -1
- package/helper/run-process.js +47 -0
- package/lint.js +4 -40
- package/package.json +18 -17
- package/stylelint/index.js +3 -1
- package/validate-stylelint-options.js +52 -0
- package/.eslintrc.js +0 -12
- package/.markdownlint.json +0 -3
- package/tsconfig.json +0 -47
package/CHANGELOG.md
CHANGED
|
@@ -6,7 +6,58 @@ 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.14.1...HEAD)
|
|
10
|
+
|
|
11
|
+
## [2.14.1] - 2022.05.05
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
- [general] Fixed empty warning for outdated `resolutions` in `package.json`
|
|
16
|
+
|
|
17
|
+
[Show all code changes](https://github.com/jens-duttke/linter-bundle/compare/v2.14.0...v2.14.1)
|
|
18
|
+
|
|
19
|
+
## [2.14.0] - 2022.05.05
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
|
|
23
|
+
- [general] Remove files from npm package which are only necessary for development
|
|
24
|
+
- [eslint] Updated `eslint-import-resolver-typescript` from `2.7.0` to `2.7.1`
|
|
25
|
+
- [eslint] Updated `@typescript-eslint` from `5.21.0` to `5.22.0`
|
|
26
|
+
- [eslint] Updated `eslint-plugin-jsdoc` from `39.2.8` to `39.2.9`
|
|
27
|
+
- [eslint] Updated `eslint-plugin-react-hooks` from `4.4.0` to `4.5.0`
|
|
28
|
+
- [stylelint] Updated `stylelint` from `14.7.1` to `14.8.2`
|
|
29
|
+
- [eslint] Make use of new [`@typescript-eslint/no-duplicate-enum-values`](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-duplicate-enum-values.md) rule
|
|
30
|
+
- [stylelint] Make use of new [`keyframe-block-no-duplicate-selectors`](https://github.com/stylelint/stylelint/blob/main/lib/rules/keyframe-block-no-duplicate-selectors/README.md) rule
|
|
31
|
+
- [stylelint] In the deployment process, ensure that the used Stylelint options are valid
|
|
32
|
+
- [stylelint] Fix invalid configuration of [`declaration-property-max-values`](https://github.com/stylelint/stylelint/blob/main/lib/rules/declaration-property-max-values/README.md) rule
|
|
33
|
+
|
|
34
|
+
[Show all code changes](https://github.com/jens-duttke/linter-bundle/compare/v2.13.0...v2.14.0)
|
|
35
|
+
|
|
36
|
+
## [2.13.0] - 2022.04.25
|
|
37
|
+
|
|
38
|
+
### Changed
|
|
39
|
+
|
|
40
|
+
- [eslint] Activate `allowExpressions` option of [`@typescript-eslint/explicit-function-return-type`](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/explicit-function-return-type.md) rule
|
|
41
|
+
- [eslint] Updated `@typescript-eslint` from `5.17.0` to `5.21.0`
|
|
42
|
+
- [eslint] Updated `eslint` from `8.12.0` to `8.14.0`
|
|
43
|
+
- [eslint] Updated `eslint-import-resolver-typescript` from `2.7.0` to `2.7.1`
|
|
44
|
+
- [eslint] Updated `eslint-plugin-functional` from `4.2.0` to `4.2.1`
|
|
45
|
+
- [eslint] Updated `eslint-plugin-import` from `2.25.4` to `2.26.0`
|
|
46
|
+
- [eslint] Updated `eslint-plugin-jest` from `26.1.3` to `26.1.5`
|
|
47
|
+
- [eslint] Updated `eslint-plugin-jsdoc` from `38.1.4` to `39.2.8`
|
|
48
|
+
- [eslint] Updated `eslint-plugin-unicorn` from `41.0.1` to `42.0.0`
|
|
49
|
+
- [stylelint] Updated `postcss-scss` from `4.0.3` to `4.0.4`
|
|
50
|
+
- [stylelint] Updated `stylelint` from `14.6.1` to `14.7.1`
|
|
51
|
+
- [eslint] Activate `allowExpressions` option of [`@typescript-eslint/explicit-function-return-type`](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/explicit-function-return-type.md) rule
|
|
52
|
+
- [eslint/overrides-jsdoc] Set [`minLineCount` option to 2](https://github.com/gajus/eslint-plugin-jsdoc/issues/870) for `require-jsdoc` rule
|
|
53
|
+
- [eslint] Reactivated the [`import/no-relative-packages`](https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-relative-packages.md) rule
|
|
54
|
+
- [eslint] Make use of new [`unicorn/no-useless-switch-case`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-switch-case.md) rule
|
|
55
|
+
- [eslint] Make use of new [`unicorn/prefer-modern-math-apis`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-modern-math-apis.md) rule
|
|
56
|
+
- [eslint] Make use of new [`unicorn/no-unreadable-iife`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unreadable-iife.md) rule
|
|
57
|
+
- [eslint] Add but disable [`unicorn/prefer-native-coercion-functions`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-native-coercion-functions.md) rule, because this would produce inconsistency in the code and is harder to read
|
|
58
|
+
- [stylelint] Set [`selector-not-notation`](https://github.com/stylelint/stylelint/blob/main/lib/rules/selector-not-notation/README.md) rule to `"complex"`
|
|
59
|
+
|
|
60
|
+
[Show all code changes](https://github.com/jens-duttke/linter-bundle/compare/v2.12.0...v2.13.0)
|
|
10
61
|
|
|
11
62
|
## [2.12.0] - 2022.03.30
|
|
12
63
|
|
|
@@ -22,7 +73,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
|
22
73
|
- [eslint] Updated `eslint-plugin-unicorn` from `41.0.0` to `41.0.1`
|
|
23
74
|
- [stylelint] Updated `stylelint` from `14.5.3` to `14.6.1`
|
|
24
75
|
- [stylelint] Updated `stylelint-scss` from `4.1.0` to `4.2.0`
|
|
25
|
-
- Updated `micromatch` from `4.0.4` to `4.0.5`
|
|
76
|
+
- [general] Updated `micromatch` from `4.0.4` to `4.0.5`
|
|
26
77
|
- [eslint] Make use of [`destructuredArrayIgnorePattern`](https://eslint.org/docs/rules/no-unused-vars#destructuredarrayignorepattern) of `@typescript-eslint/no-unused-vars` rule, to ignore variables with leading underscore.
|
|
27
78
|
- [stylelint] Make use of [`declaration-property-max-values`](https://stylelint.io/user-guide/rules/list/declaration-property-max-values/) rule, and set `unprefixed-property-name` to `4`
|
|
28
79
|
- [stylelint] Replace `function-no-unknown` by `scss/function-no-unknown`
|
|
@@ -42,7 +93,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
|
42
93
|
|
|
43
94
|
### Added
|
|
44
95
|
|
|
45
|
-
- Ensures that the ["overrides"](https://docs.npmjs.com/cli/v8/configuring-npm/package-json#overrides) and ["resolutions"](https://classic.yarnpkg.com/en/docs/selective-version-resolutions/) configuration in the `package.json` is up-to-date for linter dependencies, to prevent errors with unknown
|
|
96
|
+
- [general] Ensures that the ["overrides"](https://docs.npmjs.com/cli/v8/configuring-npm/package-json#overrides) and ["resolutions"](https://classic.yarnpkg.com/en/docs/selective-version-resolutions/) configuration in the `package.json` is up-to-date for linter dependencies, to prevent errors with unknown
|
|
46
97
|
linter rules or options.
|
|
47
98
|
|
|
48
99
|
### Changed
|
|
@@ -93,8 +144,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
|
93
144
|
|
|
94
145
|
### Added
|
|
95
146
|
|
|
96
|
-
- `--timing` argument to show information how long each linting process was running.
|
|
97
|
-
- Experimental `--git` argument to only lint (ESLint, Stylelint and Markdownlint) files which have been detected as changed (compared to the upstream branch) by Git
|
|
147
|
+
- [general] `--timing` argument to show information how long each linting process was running.
|
|
148
|
+
- [general] Experimental `--git` argument to only lint (ESLint, Stylelint and Markdownlint) files which have been detected as changed (compared to the upstream branch) by Git
|
|
98
149
|
|
|
99
150
|
[Show all code changes](https://github.com/jens-duttke/linter-bundle/compare/v2.8.4...v2.9.0)
|
|
100
151
|
|
|
@@ -332,7 +383,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
|
332
383
|
|
|
333
384
|
### Changed
|
|
334
385
|
|
|
335
|
-
- The minimum required Node.js version is v14 now
|
|
386
|
+
- [general] The minimum required Node.js version is v14 now
|
|
336
387
|
- [eslint] Updated `@typescript-eslint` from v4.31.0 to v4.31.1
|
|
337
388
|
- [eslint] Updated `eslint-import-resolver-typescript` from v2.4.0 to v2.5.0
|
|
338
389
|
- [eslint] Updated `eslint-plugin-jest` from v24.4.0 to v24.4.2
|
|
@@ -721,7 +772,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
|
721
772
|
|
|
722
773
|
### Changed
|
|
723
774
|
|
|
724
|
-
- By default, the terminal output of the linters is printed only in case of failure to prevent unnecessary noise. Use `--verbose` to show their output even on success.
|
|
775
|
+
- [general] By default, the terminal output of the linters is printed only in case of failure to prevent unnecessary noise. Use `--verbose` to show their output even on success.
|
|
725
776
|
- [stylelint] Disallow reserved ECMAScript keywords (`abstract`, `arguments`, `await`, `boolean`, `break`, `byte`, `case`, `catch`, `char`, `class`, `const`, `continue`, `debugger`, `default`, `delete`, `do`, `double`, `else`, `enum`, `eval`, `export`, `extends`, `false`, `final`, `finally`,
|
|
726
777
|
`float`, `for`, `function`, `goto`, `if`, `implements`, `import`, `in`, `Infinity`, `instanceof`, `int`, `interface`, `let`, `long`, `NaN`, `native`, `new`, `null`, `package`, `private`, `protected`, `public`, `return`, `short`, `static`, `super`, `switch`, `synchronized`, `this`, `throw`,
|
|
727
778
|
`throws`, `transient`, `true`, `try`, `typeof`, `undefined`, `var`, `void`, `volatile`, `while`, `with`, and `yield`) as class names
|
package/eslint/index.js
CHANGED
|
@@ -426,7 +426,7 @@ module.exports = {
|
|
|
426
426
|
'@typescript-eslint/consistent-type-exports': 'error',
|
|
427
427
|
'@typescript-eslint/consistent-type-imports': ['error', { disallowTypeAnnotations: false }],
|
|
428
428
|
'@typescript-eslint/dot-notation': 'error',
|
|
429
|
-
'@typescript-eslint/explicit-function-return-type': 'error',
|
|
429
|
+
'@typescript-eslint/explicit-function-return-type': ['error', { allowExpressions: true }],
|
|
430
430
|
'@typescript-eslint/explicit-member-accessibility': ['error', {
|
|
431
431
|
ignoredMethodNames: [
|
|
432
432
|
'constructor',
|
|
@@ -628,6 +628,7 @@ module.exports = {
|
|
|
628
628
|
'@typescript-eslint/no-confusing-non-null-assertion': 'error',
|
|
629
629
|
'@typescript-eslint/no-confusing-void-expression': ['error', { ignoreArrowShorthand: true, ignoreVoidOperator: true }],
|
|
630
630
|
'@typescript-eslint/no-dupe-class-members': 'error',
|
|
631
|
+
'@typescript-eslint/no-duplicate-enum-values': 'error',
|
|
631
632
|
'@typescript-eslint/no-duplicate-imports': 'error',
|
|
632
633
|
'@typescript-eslint/no-dynamic-delete': 'error',
|
|
633
634
|
'@typescript-eslint/no-empty-function': 'error',
|
|
@@ -800,7 +801,7 @@ module.exports = {
|
|
|
800
801
|
'import/no-named-export': 'off',
|
|
801
802
|
'import/no-namespace': 'off', // @todo Enabling this produces a JavaScript error in the rule; anyhow - could that reduce the package size, because of improved tree-shaking/dead-code-elimination?
|
|
802
803
|
'import/no-nodejs-modules': 'error',
|
|
803
|
-
|
|
804
|
+
'import/no-relative-packages': 'error',
|
|
804
805
|
'import/no-relative-parent-imports': 'off', // @todo Disabled because of a bug on Windows, re-enable as soon as it's resolved: https://github.com/import-js/eslint-plugin-import/issues/1644
|
|
805
806
|
'import/no-restricted-paths': 'error',
|
|
806
807
|
'import/no-self-import': 'error',
|
|
@@ -961,6 +962,7 @@ module.exports = {
|
|
|
961
962
|
'unicorn/no-thenable': 'error',
|
|
962
963
|
'unicorn/no-this-assignment': 'error',
|
|
963
964
|
'unicorn/no-unreadable-array-destructuring': 'error',
|
|
965
|
+
'unicorn/no-unreadable-iife': 'error',
|
|
964
966
|
'unicorn/no-unsafe-regex': 'off',
|
|
965
967
|
'unicorn/no-unused-properties': 'error',
|
|
966
968
|
'unicorn/no-useless-fallback-in-spread': 'error',
|
|
@@ -968,6 +970,7 @@ module.exports = {
|
|
|
968
970
|
'unicorn/no-invalid-remove-event-listener': 'error',
|
|
969
971
|
'unicorn/no-useless-length-check': 'error',
|
|
970
972
|
'unicorn/no-useless-spread': 'error',
|
|
973
|
+
'unicorn/no-useless-switch-case': 'error',
|
|
971
974
|
'unicorn/no-useless-undefined': ['error', { checkArguments: false }],
|
|
972
975
|
'unicorn/no-zero-fractions': 'error',
|
|
973
976
|
'unicorn/number-literal-case': 'error',
|
|
@@ -992,7 +995,9 @@ module.exports = {
|
|
|
992
995
|
'unicorn/prefer-keyboard-event-key': 'error',
|
|
993
996
|
'unicorn/prefer-math-trunc': 'error',
|
|
994
997
|
'unicorn/prefer-modern-dom-apis': 'error',
|
|
998
|
+
'unicorn/prefer-modern-math-apis': 'error',
|
|
995
999
|
'unicorn/prefer-module': 'off',
|
|
1000
|
+
'unicorn/prefer-native-coercion-functions': 'off',
|
|
996
1001
|
'unicorn/prefer-negative-index': 'error',
|
|
997
1002
|
'unicorn/prefer-number-properties': 'error',
|
|
998
1003
|
'unicorn/prefer-object-has-own': 'off', // Not widely supported yet. Can be activated in 2024
|
|
@@ -50,7 +50,7 @@ module.exports = {
|
|
|
50
50
|
'jsdoc/require-example': 'off',
|
|
51
51
|
'jsdoc/require-file-overview': 'error',
|
|
52
52
|
'jsdoc/require-hyphen-before-param-description': 'error',
|
|
53
|
-
'jsdoc/require-jsdoc': 'error',
|
|
53
|
+
'jsdoc/require-jsdoc': ['error', { minLineCount: 2 }],
|
|
54
54
|
'jsdoc/require-param-description': 'error',
|
|
55
55
|
'jsdoc/require-param-name': 'error',
|
|
56
56
|
'jsdoc/require-param-type': 'error',
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Executes a process asynchronously.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/** @typedef {{ code: number; stdout: string; stderr: string; runtime: number; }} ProcessResult */
|
|
6
|
+
|
|
7
|
+
const childProcess = require('child_process');
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Executes a process asynchronously.
|
|
11
|
+
*
|
|
12
|
+
* @param {string} command - The process to execute.
|
|
13
|
+
* @param {childProcess.ExecOptions | undefined} [options] - The options of the `childProcess.exec()` method.
|
|
14
|
+
* @returns {Promise<ProcessResult>} An object containing the result of the process execution
|
|
15
|
+
*/
|
|
16
|
+
async function runProcess (command, options) {
|
|
17
|
+
return new Promise((resolve) => {
|
|
18
|
+
const startTimestamp = performance.now();
|
|
19
|
+
|
|
20
|
+
/** @type {string[]} */
|
|
21
|
+
const stdout = [];
|
|
22
|
+
|
|
23
|
+
/** @type {string[]} */
|
|
24
|
+
const stderr = [];
|
|
25
|
+
|
|
26
|
+
const lintingProcess = childProcess.exec(command, options);
|
|
27
|
+
|
|
28
|
+
lintingProcess.stdout?.on('data', (/** @type {string} */data) => {
|
|
29
|
+
stdout.push(data);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
lintingProcess.stderr?.on('data', (/** @type {string} */data) => {
|
|
33
|
+
stderr.push(data);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
lintingProcess.on('exit', (code) => resolve({
|
|
37
|
+
code: code ?? 0,
|
|
38
|
+
stdout: stdout.join(''),
|
|
39
|
+
stderr: stderr.join(''),
|
|
40
|
+
runtime: performance.now() - startTimestamp
|
|
41
|
+
}));
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
module.exports = {
|
|
46
|
+
runProcess
|
|
47
|
+
};
|
package/lint.js
CHANGED
|
@@ -4,18 +4,18 @@
|
|
|
4
4
|
* @file Entry point of the linter-bundle.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
const childProcess = require('child_process');
|
|
8
7
|
const fs = require('fs');
|
|
9
8
|
const path = require('path');
|
|
10
9
|
const tty = require('tty');
|
|
11
10
|
|
|
12
11
|
const micromatch = require('micromatch');
|
|
13
12
|
|
|
13
|
+
const { runProcess } = require('./helper/run-process.js');
|
|
14
14
|
const { validatePackageOverrides } = require('./helper/validate-package-overrides.js');
|
|
15
15
|
|
|
16
|
+
/** @typedef {import('./helper/run-process').ProcessResult} ProcessResult */
|
|
16
17
|
/** @typedef {{ taskName: string; config: Partial<Record<string, (string | true)[]>>; }} TaskNameAndConfig */
|
|
17
|
-
/** @typedef {TaskNameAndConfig & { command: string; options?:
|
|
18
|
-
/** @typedef {{ code: number; stdout: string; stderr: string; runtime: number; }} ProcessResult */
|
|
18
|
+
/** @typedef {TaskNameAndConfig & { command: string; options?: import('child_process').ExecOptions; }} TaskSetup */
|
|
19
19
|
/** @typedef {{ jobTitle: string; taskSetup: TaskSetup; job: Promise<ProcessResult>; }} Job */
|
|
20
20
|
|
|
21
21
|
const isTerminal = tty.isatty(1);
|
|
@@ -29,7 +29,7 @@ void (async () => {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
if (outdatedOverrides.resolutions.length > 0) {
|
|
32
|
-
process.stderr.write(`Outdated "resolutions" in package.json detected:\n- ${outdatedOverrides.
|
|
32
|
+
process.stderr.write(`Outdated "resolutions" in package.json detected:\n- ${outdatedOverrides.resolutions.map((dependency) => `${dependency.name}: ${dependency.configuredVersion} is configured, but ${dependency.expectedVersion} is expected`).join('\n- ')}\n\n`);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
process.exitCode = 1;
|
|
@@ -378,42 +378,6 @@ function generateDummyJobOutput (taskName, config, output) {
|
|
|
378
378
|
};
|
|
379
379
|
}
|
|
380
380
|
|
|
381
|
-
/**
|
|
382
|
-
* Exectues a process asynchronously.
|
|
383
|
-
*
|
|
384
|
-
* @param {string} command - The process to execute.
|
|
385
|
-
* @param {childProcess.ExecOptions | undefined} [options] - The options of the `childProcess.exec()` method.
|
|
386
|
-
* @returns {Promise<ProcessResult>} An object containing the result of the process execution
|
|
387
|
-
*/
|
|
388
|
-
async function runProcess (command, options) {
|
|
389
|
-
return new Promise((resolve) => {
|
|
390
|
-
const startTimestamp = performance.now();
|
|
391
|
-
|
|
392
|
-
/** @type {string[]} */
|
|
393
|
-
const stdout = [];
|
|
394
|
-
|
|
395
|
-
/** @type {string[]} */
|
|
396
|
-
const stderr = [];
|
|
397
|
-
|
|
398
|
-
const lintingProcess = childProcess.exec(command, options);
|
|
399
|
-
|
|
400
|
-
lintingProcess.stdout?.on('data', (/** @type {string} */data) => {
|
|
401
|
-
stdout.push(data);
|
|
402
|
-
});
|
|
403
|
-
|
|
404
|
-
lintingProcess.stderr?.on('data', (/** @type {string} */data) => {
|
|
405
|
-
stderr.push(data);
|
|
406
|
-
});
|
|
407
|
-
|
|
408
|
-
lintingProcess.on('exit', (code) => resolve({
|
|
409
|
-
code: code ?? 0,
|
|
410
|
-
stdout: stdout.join(''),
|
|
411
|
-
stderr: stderr.join(''),
|
|
412
|
-
runtime: performance.now() - startTimestamp
|
|
413
|
-
}));
|
|
414
|
-
});
|
|
415
|
-
}
|
|
416
|
-
|
|
417
381
|
/**
|
|
418
382
|
* Returns the title (command line string) of a specific job.
|
|
419
383
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "linter-bundle",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.14.1",
|
|
4
4
|
"description": "Ready-to use bundle of linting tools, containing configurations for ESLint, stylelint and markdownlint.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -32,33 +32,34 @@
|
|
|
32
32
|
"publish:major": "npm version major",
|
|
33
33
|
"publish:minor": "npm version minor",
|
|
34
34
|
"publish:patch": "npm version patch",
|
|
35
|
-
"lint": "node ./lint tsc ts md audit --min-severity=critical",
|
|
35
|
+
"lint": "npm run validate-stylelint-options && node ./lint tsc ts md audit --min-severity=critical",
|
|
36
36
|
"preversion": "npm run check-outdated && npm run stylelint-find-rules && 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
|
+
"validate-stylelint-options": "node ./validate-stylelint-options",
|
|
39
40
|
"check-outdated": "npx --yes -- check-outdated --ignore-pre-releases"
|
|
40
41
|
},
|
|
41
42
|
"dependencies": {
|
|
42
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
43
|
-
"@typescript-eslint/parser": "5.
|
|
44
|
-
"eslint": "8.
|
|
45
|
-
"eslint-import-resolver-typescript": "2.7.
|
|
43
|
+
"@typescript-eslint/eslint-plugin": "5.22.0",
|
|
44
|
+
"@typescript-eslint/parser": "5.22.0",
|
|
45
|
+
"eslint": "8.14.0",
|
|
46
|
+
"eslint-import-resolver-typescript": "2.7.1",
|
|
46
47
|
"eslint-import-resolver-webpack": "0.13.2",
|
|
47
48
|
"eslint-plugin-eslint-comments": "3.2.0",
|
|
48
|
-
"eslint-plugin-functional": "4.2.
|
|
49
|
-
"eslint-plugin-import": "2.
|
|
50
|
-
"eslint-plugin-jest": "26.1.
|
|
51
|
-
"eslint-plugin-jsdoc": "
|
|
49
|
+
"eslint-plugin-functional": "4.2.1",
|
|
50
|
+
"eslint-plugin-import": "2.26.0",
|
|
51
|
+
"eslint-plugin-jest": "26.1.5",
|
|
52
|
+
"eslint-plugin-jsdoc": "39.2.9",
|
|
52
53
|
"eslint-plugin-jsx-a11y": "6.5.1",
|
|
53
54
|
"eslint-plugin-node": "11.1.0",
|
|
54
55
|
"eslint-plugin-promise": "6.0.0",
|
|
55
56
|
"eslint-plugin-react": "7.29.4",
|
|
56
|
-
"eslint-plugin-react-hooks": "4.
|
|
57
|
-
"eslint-plugin-unicorn": "
|
|
57
|
+
"eslint-plugin-react-hooks": "4.5.0",
|
|
58
|
+
"eslint-plugin-unicorn": "42.0.0",
|
|
58
59
|
"markdownlint-cli": "0.31.1",
|
|
59
60
|
"micromatch": "4.0.5",
|
|
60
|
-
"postcss-scss": "4.0.
|
|
61
|
-
"stylelint": "14.
|
|
61
|
+
"postcss-scss": "4.0.4",
|
|
62
|
+
"stylelint": "14.8.2",
|
|
62
63
|
"stylelint-declaration-block-no-ignored-properties": "2.5.0",
|
|
63
64
|
"stylelint-order": "5.0.0",
|
|
64
65
|
"stylelint-scss": "4.2.0",
|
|
@@ -70,10 +71,10 @@
|
|
|
70
71
|
"typescript": "^4.0.0"
|
|
71
72
|
},
|
|
72
73
|
"devDependencies": {
|
|
73
|
-
"@types/eslint": "8.4.
|
|
74
|
+
"@types/eslint": "8.4.2",
|
|
74
75
|
"@types/micromatch": "4.0.2",
|
|
75
|
-
"@types/node": "17.0.
|
|
76
|
+
"@types/node": "17.0.31",
|
|
76
77
|
"stylelint-find-new-rules": "4.0.0",
|
|
77
|
-
"typescript": "4.6.
|
|
78
|
+
"typescript": "4.6.4"
|
|
78
79
|
}
|
|
79
80
|
}
|
package/stylelint/index.js
CHANGED
|
@@ -157,7 +157,7 @@ module.exports = {
|
|
|
157
157
|
]
|
|
158
158
|
}
|
|
159
159
|
],
|
|
160
|
-
'declaration-property-max-values':
|
|
160
|
+
'declaration-property-max-values': { '/.*/': 4 },
|
|
161
161
|
'declaration-no-important': [true, {
|
|
162
162
|
severity: 'warning'
|
|
163
163
|
}],
|
|
@@ -194,6 +194,7 @@ module.exports = {
|
|
|
194
194
|
'function-whitespace-after': 'always',
|
|
195
195
|
'hue-degree-notation': 'number', // @todo change that to 'angle'?
|
|
196
196
|
'indentation': 'tab',
|
|
197
|
+
'keyframe-block-no-duplicate-selectors': true,
|
|
197
198
|
'keyframe-declaration-no-important': true,
|
|
198
199
|
'keyframes-name-pattern': '^[a-z]+(-[a-z]+)*\\d*$',
|
|
199
200
|
'length-zero-no-unit': true,
|
|
@@ -290,6 +291,7 @@ module.exports = {
|
|
|
290
291
|
'selector-nested-pattern': null,
|
|
291
292
|
'selector-no-qualifying-type': [true, { ignore: ['attribute', 'class'] }],
|
|
292
293
|
'selector-no-vendor-prefix': true,
|
|
294
|
+
'selector-not-notation': 'complex',
|
|
293
295
|
'selector-pseudo-class-allowed-list': null,
|
|
294
296
|
'selector-pseudo-class-case': 'lower',
|
|
295
297
|
'selector-pseudo-class-disallowed-list': null,
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Ensures that stylelint options are valid by checking the `invalidOptionWarnings` property of the JSON response.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
const fs = require('fs');
|
|
6
|
+
const os = require('os');
|
|
7
|
+
const path = require('path');
|
|
8
|
+
|
|
9
|
+
const { runProcess } = require('./helper/run-process.js');
|
|
10
|
+
|
|
11
|
+
void (async () => {
|
|
12
|
+
const temporaryPath = path.join(os.tmpdir(), 'linter-bundle-');
|
|
13
|
+
|
|
14
|
+
const folder = fs.mkdtempSync(temporaryPath);
|
|
15
|
+
|
|
16
|
+
const tempFilePath = path.join(folder, 'tmp.scss');
|
|
17
|
+
|
|
18
|
+
fs.writeFileSync(tempFilePath, '* {\n\tborder: 1px solid var(--color);\n\n\tcolor: var(--color);\n}\n', 'utf8');
|
|
19
|
+
|
|
20
|
+
const result = await runProcess(`stylelint -f json "${tempFilePath}"`);
|
|
21
|
+
|
|
22
|
+
fs.unlinkSync(tempFilePath);
|
|
23
|
+
|
|
24
|
+
if (result.stderr) {
|
|
25
|
+
process.stderr.write(result.stderr);
|
|
26
|
+
|
|
27
|
+
process.exitCode = 1;
|
|
28
|
+
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @type {import('stylelint').LintResult}
|
|
34
|
+
*/
|
|
35
|
+
const { invalidOptionWarnings, warnings } = JSON.parse(result.stdout)[0];
|
|
36
|
+
|
|
37
|
+
if (warnings.length > 0) {
|
|
38
|
+
process.stderr.write(warnings.join('\n'));
|
|
39
|
+
|
|
40
|
+
process.exitCode = 1;
|
|
41
|
+
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (invalidOptionWarnings.length > 0) {
|
|
46
|
+
process.stderr.write(`Invalid stylelint configuration:\n\n- ${invalidOptionWarnings.map(({ text }) => text).join('\n- ')}`);
|
|
47
|
+
|
|
48
|
+
process.exitCode = 1;
|
|
49
|
+
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
})();
|
package/.eslintrc.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Configuration used for linting the linter-bundle.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
module.exports = {
|
|
6
|
-
root: true,
|
|
7
|
-
extends: [
|
|
8
|
-
require.resolve('./eslint'),
|
|
9
|
-
require.resolve('./eslint/overrides-javascript-lazy'),
|
|
10
|
-
require.resolve('./eslint/overrides-jsdoc')
|
|
11
|
-
]
|
|
12
|
-
};
|
package/.markdownlint.json
DELETED
package/tsconfig.json
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
// General settings for code interpretation
|
|
4
|
-
"target": "esnext",
|
|
5
|
-
"module": "commonjs",
|
|
6
|
-
"resolveJsonModule": true,
|
|
7
|
-
"checkJs": true,
|
|
8
|
-
"noEmit": true,
|
|
9
|
-
|
|
10
|
-
"baseUrl": ".",
|
|
11
|
-
|
|
12
|
-
// General settings for code generation
|
|
13
|
-
"newLine": "LF",
|
|
14
|
-
|
|
15
|
-
// Console output settings
|
|
16
|
-
"pretty": true,
|
|
17
|
-
|
|
18
|
-
// Code validation
|
|
19
|
-
"allowUnreachableCode": false,
|
|
20
|
-
"allowUnusedLabels": false,
|
|
21
|
-
"alwaysStrict": true,
|
|
22
|
-
"exactOptionalPropertyTypes": true,
|
|
23
|
-
"forceConsistentCasingInFileNames": true,
|
|
24
|
-
"keyofStringsOnly": false,
|
|
25
|
-
"noFallthroughCasesInSwitch": true,
|
|
26
|
-
"noImplicitAny": true,
|
|
27
|
-
"noImplicitReturns": true,
|
|
28
|
-
"noImplicitThis": true,
|
|
29
|
-
"noImplicitUseStrict": false,
|
|
30
|
-
"noPropertyAccessFromIndexSignature": true,
|
|
31
|
-
"noUnusedLocals": true,
|
|
32
|
-
"noUnusedParameters": true,
|
|
33
|
-
"strict": true,
|
|
34
|
-
"strictBindCallApply": true,
|
|
35
|
-
"strictFunctionTypes": true,
|
|
36
|
-
"strictNullChecks": true,
|
|
37
|
-
"strictPropertyInitialization": true,
|
|
38
|
-
"suppressExcessPropertyErrors": false,
|
|
39
|
-
"suppressImplicitAnyIndexErrors": true,
|
|
40
|
-
"useUnknownInCatchVariables": true
|
|
41
|
-
},
|
|
42
|
-
"include": [
|
|
43
|
-
"./types.d.ts",
|
|
44
|
-
"**/*.js",
|
|
45
|
-
"./.eslintrc.js"
|
|
46
|
-
]
|
|
47
|
-
}
|