linter-bundle 2.13.0 → 2.15.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 CHANGED
@@ -6,7 +6,41 @@ 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.13.0...HEAD)
9
+ [Show all code changes](https://github.com/jens-duttke/linter-bundle/compare/v2.15.0...HEAD)
10
+
11
+ ## [2.15.0] - 2022.05.05
12
+
13
+ ### Changed
14
+
15
+ - [stylelint] Disabled `declaration-property-max-values` rule because of false-positives.
16
+ - [stylelint] Disabled `selector-not-notation` for now, because it depends on the project if modern Selectors Level 4 CSS can be used.
17
+
18
+ [Show all code changes](https://github.com/jens-duttke/linter-bundle/compare/v2.14.1...v2.15.0)
19
+
20
+ ## [2.14.1] - 2022.05.05
21
+
22
+ ### Fixed
23
+
24
+ - [general] Fixed empty warning for outdated `resolutions` in `package.json`
25
+
26
+ [Show all code changes](https://github.com/jens-duttke/linter-bundle/compare/v2.14.0...v2.14.1)
27
+
28
+ ## [2.14.0] - 2022.05.05
29
+
30
+ ### Changed
31
+
32
+ - [general] Remove files from npm package which are only necessary for development
33
+ - [eslint] Updated `eslint-import-resolver-typescript` from `2.7.0` to `2.7.1`
34
+ - [eslint] Updated `@typescript-eslint` from `5.21.0` to `5.22.0`
35
+ - [eslint] Updated `eslint-plugin-jsdoc` from `39.2.8` to `39.2.9`
36
+ - [eslint] Updated `eslint-plugin-react-hooks` from `4.4.0` to `4.5.0`
37
+ - [stylelint] Updated `stylelint` from `14.7.1` to `14.8.2`
38
+ - [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
39
+ - [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
40
+ - [stylelint] In the deployment process, ensure that the used Stylelint options are valid
41
+ - [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
42
+
43
+ [Show all code changes](https://github.com/jens-duttke/linter-bundle/compare/v2.13.0...v2.14.0)
10
44
 
11
45
  ## [2.13.0] - 2022.04.25
12
46
 
@@ -26,11 +60,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
26
60
  - [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
27
61
  - [eslint/overrides-jsdoc] Set [`minLineCount` option to 2](https://github.com/gajus/eslint-plugin-jsdoc/issues/870) for `require-jsdoc` rule
28
62
  - [eslint] Reactivated the [`import/no-relative-packages`](https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-relative-packages.md) rule
29
- - [eslint] Make use of [`unicorn/no-useless-switch-case`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-switch-case.md) rule
30
- - [eslint] Make use of [`unicorn/prefer-modern-math-apis`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-modern-math-apis.md) rule
31
- - [eslint] Make use of [`unicorn/no-unreadable-iife`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unreadable-iife.md) rule
63
+ - [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
64
+ - [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
65
+ - [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
32
66
  - [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
33
- - [stylelint] Set new [`selector-not-notation`](https://github.com/stylelint/stylelint/blob/main/lib/rules/selector-not-notation/README.md) rule to `"complex"`
67
+ - [stylelint] Set [`selector-not-notation`](https://github.com/stylelint/stylelint/blob/main/lib/rules/selector-not-notation/README.md) rule to `"complex"`
34
68
 
35
69
  [Show all code changes](https://github.com/jens-duttke/linter-bundle/compare/v2.12.0...v2.13.0)
36
70
 
@@ -48,7 +82,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
48
82
  - [eslint] Updated `eslint-plugin-unicorn` from `41.0.0` to `41.0.1`
49
83
  - [stylelint] Updated `stylelint` from `14.5.3` to `14.6.1`
50
84
  - [stylelint] Updated `stylelint-scss` from `4.1.0` to `4.2.0`
51
- - Updated `micromatch` from `4.0.4` to `4.0.5`
85
+ - [general] Updated `micromatch` from `4.0.4` to `4.0.5`
52
86
  - [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.
53
87
  - [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`
54
88
  - [stylelint] Replace `function-no-unknown` by `scss/function-no-unknown`
@@ -68,7 +102,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
68
102
 
69
103
  ### Added
70
104
 
71
- - 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
105
+ - [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
72
106
  linter rules or options.
73
107
 
74
108
  ### Changed
@@ -119,8 +153,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
119
153
 
120
154
  ### Added
121
155
 
122
- - `--timing` argument to show information how long each linting process was running.
123
- - Experimental `--git` argument to only lint (ESLint, Stylelint and Markdownlint) files which have been detected as changed (compared to the upstream branch) by Git
156
+ - [general] `--timing` argument to show information how long each linting process was running.
157
+ - [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
124
158
 
125
159
  [Show all code changes](https://github.com/jens-duttke/linter-bundle/compare/v2.8.4...v2.9.0)
126
160
 
@@ -358,7 +392,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
358
392
 
359
393
  ### Changed
360
394
 
361
- - The minimum required Node.js version is v14 now
395
+ - [general] The minimum required Node.js version is v14 now
362
396
  - [eslint] Updated `@typescript-eslint` from v4.31.0 to v4.31.1
363
397
  - [eslint] Updated `eslint-import-resolver-typescript` from v2.4.0 to v2.5.0
364
398
  - [eslint] Updated `eslint-plugin-jest` from v24.4.0 to v24.4.2
@@ -747,7 +781,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
747
781
 
748
782
  ### Changed
749
783
 
750
- - 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.
784
+ - [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.
751
785
  - [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`,
752
786
  `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`,
753
787
  `throws`, `transient`, `true`, `try`, `typeof`, `undefined`, `var`, `void`, `volatile`, `while`, `with`, and `yield`) as class names
package/README.md CHANGED
@@ -81,6 +81,27 @@ npm install linter-bundle --save-dev
81
81
 
82
82
  #### .eslintrc.js
83
83
 
84
+ ##### Minimum configuration
85
+
86
+ ```js
87
+ module.exports = {
88
+ extends: [
89
+ require.resolve('linter-bundle/eslint'),
90
+ // require.resolve('linter-bundle/eslint/overrides-gatsby'),
91
+ // require.resolve('linter-bundle/eslint/overrides-javascript'),
92
+ require.resolve('linter-bundle/eslint/overrides-javascript-lazy'),
93
+ // require.resolve('linter-bundle/eslint/overrides-jest'),
94
+ require.resolve('linter-bundle/eslint/overrides-jsdoc'),
95
+ // require.resolve('linter-bundle/eslint/overrides-react'),
96
+ // require.resolve('linter-bundle/eslint/overrides-storybook'),
97
+ // require.resolve('linter-bundle/eslint/overrides-type-declarations'),
98
+ // require.resolve('linter-bundle/eslint/overrides-worker')
99
+ ]
100
+ };
101
+ ```
102
+
103
+ ##### Maximum configuration
104
+
84
105
  ```js
85
106
  // Sometimes it's required to adjust specific settings. These can be defined here:
86
107
  global.linterBundleSettings = {
@@ -202,7 +223,7 @@ module.exports = {
202
223
 
203
224
  #### .gitignore / .npmignore
204
225
 
205
- ```json
226
+ ```cmd
206
227
  .eslintcache
207
228
  ```
208
229
 
@@ -389,3 +410,17 @@ To visualize the max line-length rules in VSCode, you can activate rulers, by ad
389
410
  }
390
411
  }
391
412
  ```
413
+
414
+ ## FAQ
415
+
416
+ ### How to solve the problem `Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser.` ?
417
+
418
+ If you get such an error message:
419
+
420
+ > Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser.
421
+ > The file does not match your project config: *[any-name]*.js.
422
+ > The file must be included in at least one of the projects provided.
423
+
424
+ the problem is most likely, that your `tsconfig.json` does not cover your JavaScript files and that you don't have a `jsconfig.json` file in your root directory. This is required by the `@typescript-eslint` to use TypeScript for linting of JavaScript files.
425
+
426
+ To solve this problem, either `"include"` your JavaScript files in your `tsconfig.json` (don't forget to set the compiler option `"checkJs"` to `true`) or create a `jsconfig.json` file in your root directory (this can be a copy of your `tsconfig.json` with an `"include"` of your JavaScript files).
package/eslint/index.js CHANGED
@@ -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',
@@ -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?: childProcess.ExecOptions; }} TaskSetup */
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.overrides.map((dependency) => `${dependency.name}: ${dependency.configuredVersion} is configured, but ${dependency.expectedVersion} is expected`).join('\n- ')}\n\n`);
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.13.0",
3
+ "version": "2.15.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,15 +32,16 @@
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.21.0",
43
- "@typescript-eslint/parser": "5.21.0",
43
+ "@typescript-eslint/eslint-plugin": "5.22.0",
44
+ "@typescript-eslint/parser": "5.22.0",
44
45
  "eslint": "8.14.0",
45
46
  "eslint-import-resolver-typescript": "2.7.1",
46
47
  "eslint-import-resolver-webpack": "0.13.2",
@@ -48,17 +49,17 @@
48
49
  "eslint-plugin-functional": "4.2.1",
49
50
  "eslint-plugin-import": "2.26.0",
50
51
  "eslint-plugin-jest": "26.1.5",
51
- "eslint-plugin-jsdoc": "39.2.8",
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.4.0",
57
+ "eslint-plugin-react-hooks": "4.5.0",
57
58
  "eslint-plugin-unicorn": "42.0.0",
58
59
  "markdownlint-cli": "0.31.1",
59
60
  "micromatch": "4.0.5",
60
61
  "postcss-scss": "4.0.4",
61
- "stylelint": "14.7.1",
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.1",
74
+ "@types/eslint": "8.4.2",
74
75
  "@types/micromatch": "4.0.2",
75
- "@types/node": "17.0.27",
76
+ "@types/node": "17.0.31",
76
77
  "stylelint-find-new-rules": "4.0.0",
77
- "typescript": "4.6.3"
78
+ "typescript": "4.6.4"
78
79
  }
79
80
  }
@@ -157,7 +157,7 @@ module.exports = {
157
157
  ]
158
158
  }
159
159
  ],
160
- 'declaration-property-max-values': [true, { 'unprefixed-property-name': 4 }],
160
+ 'declaration-property-max-values': null, // { '/.*/': 4 }, @todo disabled because of false-positive with `padding-inline-start: #{24px + $i * 16px};` and `transition: transform, background-color, color, border-color, box-shadow;`
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,7 +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,
293
- 'selector-not-notation': 'complex',
294
+ '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.
294
295
  'selector-pseudo-class-allowed-list': null,
295
296
  'selector-pseudo-class-case': 'lower',
296
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
- };
@@ -1,3 +0,0 @@
1
- {
2
- "extends": "markdownlint/base.json"
3
- }
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
- }