@storm-software/linting-tools 1.44.7 → 1.44.9

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.
Files changed (43) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/LICENSE +201 -0
  3. package/README.md +1 -1
  4. package/bin/lint.js +334927 -0
  5. package/package.json +1 -1
  6. package/src/cli/index.js +328523 -0
  7. package/src/eslint/graphql/{index.ts → index.js} +7 -4
  8. package/src/eslint/{rules/storm.ts → javascript/index.js} +136 -3
  9. package/src/eslint/jest/index.js +19 -0
  10. package/src/eslint/json/index.js +90 -0
  11. package/src/eslint/next/index.js +90 -0
  12. package/src/eslint/{rules/react.ts → react/index.js} +39 -3
  13. package/src/eslint/typescript/index.js +558 -0
  14. package/src/manypkg/index.js +34729 -0
  15. package/.eslintrc.json +0 -97
  16. package/jest.config.ts +0 -11
  17. package/project.json +0 -120
  18. package/src/alex/index.ts +0 -67
  19. package/src/cli/index.ts +0 -300
  20. package/src/eslint/constants.ts +0 -87
  21. package/src/eslint/index.ts +0 -7
  22. package/src/eslint/javascript/index.ts +0 -22
  23. package/src/eslint/jest/index.ts +0 -16
  24. package/src/eslint/json/index.ts +0 -32
  25. package/src/eslint/next/index.ts +0 -25
  26. package/src/eslint/react/index.ts +0 -25
  27. package/src/eslint/rules/import.ts +0 -85
  28. package/src/eslint/rules/jsx-a11y.ts +0 -8
  29. package/src/eslint/rules/ts-docs.ts +0 -12
  30. package/src/eslint/rules/unicorn.ts +0 -23
  31. package/src/eslint/typescript/index.ts +0 -132
  32. package/src/manypkg/index.ts +0 -164
  33. package/tsconfig.json +0 -25
  34. package/tsconfig.spec.json +0 -13
  35. /package/{src/alex → alex}/.alexignore +0 -0
  36. /package/{src/alex → alex}/.alexrc +0 -0
  37. /package/{src/biome → biome}/biome.json +0 -0
  38. /package/{src/cspell → cspell}/config.json +0 -0
  39. /package/{src/cspell → cspell}/dictionary.txt +0 -0
  40. /package/{src/ls-lint → ls-lint}/.ls-lint.yml +0 -0
  41. /package/{src/prettier → prettier}/.prettierignore +0 -0
  42. /package/{src/prettier → prettier}/config.json +0 -0
  43. /package/{src/taplo → taplo}/.taplo.toml +0 -0
@@ -1,6 +1,7 @@
1
- import type { Linter } from "eslint";
1
+ const require = (await import('node:module')).createRequire(import.meta.url);const __filename = (await import('node:url')).fileURLToPath(import.meta.url);const __dirname = (await import('node:path')).dirname(__filename);
2
2
 
3
- const config: Linter.Config = {
3
+ // packages/linting-tools/src/eslint/graphql/index.ts
4
+ var config = {
4
5
  root: true,
5
6
  overrides: [
6
7
  {
@@ -121,5 +122,7 @@ const config: Linter.Config = {
121
122
  }
122
123
  ]
123
124
  };
124
-
125
- export default config;
125
+ var graphql_default = config;
126
+ export {
127
+ graphql_default as default
128
+ };
@@ -1,6 +1,97 @@
1
- import type { Linter } from "eslint";
1
+ const require = (await import('node:module')).createRequire(import.meta.url);const __filename = (await import('node:url')).fileURLToPath(import.meta.url);const __dirname = (await import('node:path')).dirname(__filename);
2
2
 
3
- const config: Linter.RulesRecord = {
3
+ // packages/linting-tools/src/eslint/rules/import.ts
4
+ var config = {
5
+ /**
6
+ * Disallow non-import statements appearing before import statements.
7
+ *
8
+ * 🚫 Not fixable - https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/first.md
9
+ */
10
+ "import/first": "error",
11
+ /**
12
+ * Require a newline after the last import/require.
13
+ *
14
+ * 🔧 Fixable - https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/newline-after-import.md
15
+ */
16
+ "import/newline-after-import": "warn",
17
+ /**
18
+ * Disallow import of modules using absolute paths.
19
+ *
20
+ * 🚫 Not fixable - https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-absolute-path.md
21
+ */
22
+ "import/no-absolute-path": "error",
23
+ /**
24
+ * Disallow cyclical dependencies between modules.
25
+ *
26
+ * 🚫 Not fixable - https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-cycle.md
27
+ */
28
+ "import/no-cycle": "error",
29
+ /**
30
+ * Disallow default exports.
31
+ *
32
+ * 🚫 Not fixable - https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-default-export.md
33
+ */
34
+ "import/no-default-export": "error",
35
+ /**
36
+ * Disallow the use of extraneous packages.
37
+ *
38
+ * 🚫 Not fixable - https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-extraneous-dependencies.md
39
+ */
40
+ "import/no-extraneous-dependencies": ["error", { includeInternal: true, includeTypes: true }],
41
+ /**
42
+ * Disallow mutable exports.
43
+ *
44
+ * 🚫 Not fixable - https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-mutable-exports.md
45
+ */
46
+ "import/no-mutable-exports": "error",
47
+ /**
48
+ * Disallow importing packages through relative paths.
49
+ *
50
+ * 🚫 Not fixable - https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-relative-packages.md
51
+ */
52
+ "import/no-relative-packages": "warn",
53
+ /**
54
+ * Disallow a module from importing itself.
55
+ *
56
+ * 🚫 Not fixable - https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-self-import.md
57
+ */
58
+ "import/no-self-import": "error",
59
+ /**
60
+ * Ensures that there are no useless path segments.
61
+ *
62
+ * 🚫 Not fixable - https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-useless-path-segments.md
63
+ */
64
+ "import/no-useless-path-segments": ["error"],
65
+ /**
66
+ * Enforce a module import order convention.
67
+ *
68
+ * 🔧 Fixable - https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/order.md
69
+ */
70
+ "import/order": [
71
+ "warn",
72
+ {
73
+ groups: [
74
+ "builtin",
75
+ // Node.js built-in modules
76
+ "external",
77
+ // Packages
78
+ "internal",
79
+ // Aliased modules
80
+ "parent",
81
+ // Relative parent
82
+ "sibling",
83
+ // Relative sibling
84
+ "index"
85
+ // Relative index
86
+ ],
87
+ "newlines-between": "never"
88
+ }
89
+ ]
90
+ };
91
+ var import_default = config;
92
+
93
+ // packages/linting-tools/src/eslint/rules/storm.ts
94
+ var config2 = {
4
95
  /**
5
96
  * Require return statements in array methods callbacks.
6
97
  *
@@ -231,5 +322,47 @@ const config: Linter.RulesRecord = {
231
322
  */
232
323
  yoda: "warn"
233
324
  };
325
+ var storm_default = config2;
234
326
 
235
- export default config;
327
+ // packages/linting-tools/src/eslint/rules/unicorn.ts
328
+ var config3 = {
329
+ /**
330
+ * Require consistent filename case for all linted files.
331
+ *
332
+ * 🚫 Not fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/filename-case.md
333
+ */
334
+ "unicorn/filename-case": [
335
+ "error",
336
+ {
337
+ case: "kebabCase"
338
+ }
339
+ ],
340
+ /**
341
+ * Require using the `node:` protocol when importing Node.js built-in modules.
342
+ *
343
+ * 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-node-protocol.md
344
+ */
345
+ "unicorn/prefer-node-protocol": "warn"
346
+ };
347
+ var unicorn_default = config3;
348
+
349
+ // packages/linting-tools/src/eslint/javascript/index.ts
350
+ var config4 = {
351
+ root: true,
352
+ overrides: [
353
+ {
354
+ files: ["*.js", "*.jsx"],
355
+ extends: ["plugin:@nx/javascript"],
356
+ plugins: ["unicorn", "import"],
357
+ rules: {
358
+ ...import_default,
359
+ ...unicorn_default,
360
+ ...storm_default
361
+ }
362
+ }
363
+ ]
364
+ };
365
+ var javascript_default = config4;
366
+ export {
367
+ javascript_default as default
368
+ };
@@ -0,0 +1,19 @@
1
+ const require = (await import('node:module')).createRequire(import.meta.url);const __filename = (await import('node:url')).fileURLToPath(import.meta.url);const __dirname = (await import('node:path')).dirname(__filename);
2
+
3
+ // packages/linting-tools/src/eslint/jest/index.ts
4
+ var config = {
5
+ root: true,
6
+ overrides: [
7
+ {
8
+ files: ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"],
9
+ env: {
10
+ jest: true
11
+ },
12
+ rules: {}
13
+ }
14
+ ]
15
+ };
16
+ var jest_default = config;
17
+ export {
18
+ jest_default as default
19
+ };
@@ -0,0 +1,90 @@
1
+ const require = (await import('node:module')).createRequire(import.meta.url);const __filename = (await import('node:url')).fileURLToPath(import.meta.url);const __dirname = (await import('node:path')).dirname(__filename);
2
+
3
+ // packages/linting-tools/src/eslint/constants.ts
4
+ var RESTRICTED_SYNTAX = [
5
+ {
6
+ // ❌ readFile(…, { encoding: … })
7
+ selector: "CallExpression[callee.name=/readFileSync|readFile|writeFileSync|writeFile/] > .arguments:last-child[type=ObjectExpression][properties.length=1] Property[key.name=encoding]",
8
+ message: "Specify encoding as last argument instead of object with encoding key"
9
+ },
10
+ {
11
+ // ❌ readFile(…, {})
12
+ selector: "CallExpression[callee.name=/readFileSync|readFile|writeFileSync|writeFile/] > .arguments:last-child[type=ObjectExpression][properties.length=0]",
13
+ message: "Specify encoding as last argument"
14
+ },
15
+ {
16
+ // ❌ readFileSync(…).toString(…)
17
+ selector: "CallExpression[callee.name=readFileSync][parent.property.name=toString]",
18
+ message: "toString is redundant, specify encoding as last argument"
19
+ },
20
+ {
21
+ // ❌ ….readFile(…, { encoding: … })
22
+ selector: "CallExpression[callee.type=MemberExpression][callee.property.name=/readFileSync|readFile|writeFileSync|writeFile/] > .arguments:last-child[type=ObjectExpression][properties.length=1] Property[key.name=encoding]",
23
+ message: "Specify encoding as last argument instead of object with encoding key"
24
+ },
25
+ {
26
+ // ❌ ….readFile(…, {})
27
+ selector: "CallExpression[callee.type=MemberExpression][callee.property.name=/readFileSync|readFile|writeFileSync|writeFile/] > .arguments:last-child[type=ObjectExpression][properties.length=0]",
28
+ message: "Specify encoding as last argument"
29
+ },
30
+ {
31
+ // ❌ Boolean(…)
32
+ selector: "CallExpression[callee.name=Boolean][arguments.1.elements.length!=0]",
33
+ message: "Prefer `!!\u2026` over `Boolean(\u2026)` because TypeScript infers a narrow literal boolean `type: true` instead of `type: boolean`."
34
+ },
35
+ {
36
+ // ❌ process.browser
37
+ selector: "ExpressionStatement[expression.object.name=process][expression.property.name=browser]",
38
+ message: "`process.browser` is deprecated, use `!!globalThis.window`"
39
+ }
40
+ // {
41
+ // // ❌ let { foo: { bar } } = baz
42
+ // // ✅ let { bar } = baz.foo
43
+ // // ✅ let { foo: { bar } } = await baz
44
+ // selector:
45
+ // 'VariableDeclarator[init.type!=AwaitExpression] > ObjectPattern[properties.length=1][properties.0.value.type=ObjectPattern]',
46
+ // message: 'Do not use nested destructuring.',
47
+ // },
48
+ ];
49
+ var REACT_RESTRICTED_SYNTAX = [
50
+ ...RESTRICTED_SYNTAX,
51
+ {
52
+ // ❌ useMemo(…, [])
53
+ selector: "CallExpression[callee.name=useMemo][arguments.1.type=ArrayExpression][arguments.1.elements.length=0]",
54
+ message: "`useMemo` with an empty dependency array can't provide a stable reference, use `useRef` instead."
55
+ }
56
+ ];
57
+ var CODE_BLOCK = "**/*.md{,x}/*";
58
+
59
+ // packages/linting-tools/src/eslint/json/index.ts
60
+ var JSONC_FILES = ["tsconfig.json", "tsconfig.base.json", "nx.json", ".vscode/launch.json"];
61
+ var config = {
62
+ root: true,
63
+ overrides: [
64
+ {
65
+ files: "*.json",
66
+ excludedFiles: JSONC_FILES,
67
+ extends: "plugin:jsonc/recommended-with-json"
68
+ },
69
+ {
70
+ files: ["*.jsonc", ...JSONC_FILES],
71
+ extends: "plugin:jsonc/recommended-with-jsonc"
72
+ },
73
+ {
74
+ files: "*.json5",
75
+ extends: "plugin:jsonc/recommended-with-json5"
76
+ },
77
+ {
78
+ files: "*.json{,c,5}",
79
+ excludedFiles: CODE_BLOCK,
80
+ plugins: ["unicorn"],
81
+ rules: {
82
+ "unicorn/filename-case": "error"
83
+ }
84
+ }
85
+ ]
86
+ };
87
+ var json_default = config;
88
+ export {
89
+ json_default as default
90
+ };
@@ -0,0 +1,90 @@
1
+ const require = (await import('node:module')).createRequire(import.meta.url);const __filename = (await import('node:url')).fileURLToPath(import.meta.url);const __dirname = (await import('node:path')).dirname(__filename);
2
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
3
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
4
+ }) : x)(function(x) {
5
+ if (typeof require !== "undefined")
6
+ return require.apply(this, arguments);
7
+ throw Error('Dynamic require of "' + x + '" is not supported');
8
+ });
9
+
10
+ // packages/linting-tools/src/eslint/constants.ts
11
+ var RESTRICTED_SYNTAX = [
12
+ {
13
+ // ❌ readFile(…, { encoding: … })
14
+ selector: "CallExpression[callee.name=/readFileSync|readFile|writeFileSync|writeFile/] > .arguments:last-child[type=ObjectExpression][properties.length=1] Property[key.name=encoding]",
15
+ message: "Specify encoding as last argument instead of object with encoding key"
16
+ },
17
+ {
18
+ // ❌ readFile(…, {})
19
+ selector: "CallExpression[callee.name=/readFileSync|readFile|writeFileSync|writeFile/] > .arguments:last-child[type=ObjectExpression][properties.length=0]",
20
+ message: "Specify encoding as last argument"
21
+ },
22
+ {
23
+ // ❌ readFileSync(…).toString(…)
24
+ selector: "CallExpression[callee.name=readFileSync][parent.property.name=toString]",
25
+ message: "toString is redundant, specify encoding as last argument"
26
+ },
27
+ {
28
+ // ❌ ….readFile(…, { encoding: … })
29
+ selector: "CallExpression[callee.type=MemberExpression][callee.property.name=/readFileSync|readFile|writeFileSync|writeFile/] > .arguments:last-child[type=ObjectExpression][properties.length=1] Property[key.name=encoding]",
30
+ message: "Specify encoding as last argument instead of object with encoding key"
31
+ },
32
+ {
33
+ // ❌ ….readFile(…, {})
34
+ selector: "CallExpression[callee.type=MemberExpression][callee.property.name=/readFileSync|readFile|writeFileSync|writeFile/] > .arguments:last-child[type=ObjectExpression][properties.length=0]",
35
+ message: "Specify encoding as last argument"
36
+ },
37
+ {
38
+ // ❌ Boolean(…)
39
+ selector: "CallExpression[callee.name=Boolean][arguments.1.elements.length!=0]",
40
+ message: "Prefer `!!\u2026` over `Boolean(\u2026)` because TypeScript infers a narrow literal boolean `type: true` instead of `type: boolean`."
41
+ },
42
+ {
43
+ // ❌ process.browser
44
+ selector: "ExpressionStatement[expression.object.name=process][expression.property.name=browser]",
45
+ message: "`process.browser` is deprecated, use `!!globalThis.window`"
46
+ }
47
+ // {
48
+ // // ❌ let { foo: { bar } } = baz
49
+ // // ✅ let { bar } = baz.foo
50
+ // // ✅ let { foo: { bar } } = await baz
51
+ // selector:
52
+ // 'VariableDeclarator[init.type!=AwaitExpression] > ObjectPattern[properties.length=1][properties.0.value.type=ObjectPattern]',
53
+ // message: 'Do not use nested destructuring.',
54
+ // },
55
+ ];
56
+ var REACT_RESTRICTED_SYNTAX = [
57
+ ...RESTRICTED_SYNTAX,
58
+ {
59
+ // ❌ useMemo(…, [])
60
+ selector: "CallExpression[callee.name=useMemo][arguments.1.type=ArrayExpression][arguments.1.elements.length=0]",
61
+ message: "`useMemo` with an empty dependency array can't provide a stable reference, use `useRef` instead."
62
+ }
63
+ ];
64
+ var JS_FILES = ["*.js?(x)", "*.mjs"];
65
+
66
+ // packages/linting-tools/src/eslint/next/index.ts
67
+ var babelOptions = {
68
+ presets: (() => {
69
+ try {
70
+ __require.resolve("next/babel");
71
+ return ["next/babel"];
72
+ } catch (_e) {
73
+ return [];
74
+ }
75
+ })()
76
+ };
77
+ var config = {
78
+ root: true,
79
+ extends: ["plugin:@next/next/recommended"],
80
+ overrides: [
81
+ {
82
+ files: JS_FILES,
83
+ parserOptions: { babelOptions }
84
+ }
85
+ ]
86
+ };
87
+ var next_default = config;
88
+ export {
89
+ next_default as default
90
+ };
@@ -1,6 +1,7 @@
1
- import type { Linter } from "eslint";
1
+ const require = (await import('node:module')).createRequire(import.meta.url);const __filename = (await import('node:url')).fileURLToPath(import.meta.url);const __dirname = (await import('node:path')).dirname(__filename);
2
2
 
3
- const config: Linter.RulesRecord = {
3
+ // packages/linting-tools/src/eslint/rules/react.ts
4
+ var config = {
4
5
  // We recommend using TypeScript over `prop-types`, as `prop-types` can add
5
6
  // to a project's build size.
6
7
  "react/prop-types": "off",
@@ -99,5 +100,40 @@ const config: Linter.RulesRecord = {
99
100
  */
100
101
  "react/self-closing-comp": "warn"
101
102
  };
103
+ var react_default = config;
102
104
 
103
- export default config;
105
+ // packages/linting-tools/src/eslint/rules/ts-docs.ts
106
+ var config2 = {
107
+ /**
108
+ * Require TSDoc comments conform to the TSDoc specification.
109
+ *
110
+ * 🚫 Not fixable - https://github.com/microsoft/tsdoc/tree/master/eslint-plugin
111
+ */
112
+ "tsdoc/syntax": "error"
113
+ };
114
+ var ts_docs_default = config2;
115
+
116
+ // packages/linting-tools/src/eslint/react/index.ts
117
+ var config3 = {
118
+ root: true,
119
+ extends: [
120
+ "plugin:react/recommended",
121
+ "plugin:react-hooks/recommended",
122
+ "plugin:jsx-a11y/recommended",
123
+ "plugin:import/react",
124
+ "prettier"
125
+ ],
126
+ settings: {
127
+ react: {
128
+ version: "detect"
129
+ }
130
+ },
131
+ rules: {
132
+ ...ts_docs_default,
133
+ ...react_default
134
+ }
135
+ };
136
+ var react_default2 = config3;
137
+ export {
138
+ react_default2 as default
139
+ };