@storm-software/eslint 0.122.8 → 0.123.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.
Files changed (73) hide show
  1. package/README.md +1 -1
  2. package/dist/chunk-7NZUDX62.js +99 -0
  3. package/dist/{chunk-Y67QTC5U.js → chunk-K6KBWFPU.js} +1 -1
  4. package/dist/{chunk-LSG5T3ZK.js → chunk-W6QEP5VE.js} +7 -6
  5. package/dist/chunk-X3L37QNE.js +161 -0
  6. package/dist/preset.d.ts +23 -7048
  7. package/dist/preset.js +3590 -933
  8. package/dist/types-Drnq7vws.d.ts +14859 -0
  9. package/dist/utils/banner-plugin.js +3 -3
  10. package/dist/utils/combine.d.ts +14 -0
  11. package/dist/utils/combine.js +13 -0
  12. package/dist/utils/constants.d.ts +33 -22
  13. package/dist/utils/constants.js +65 -19
  14. package/dist/utils/get-file-banner.js +2 -2
  15. package/dist/utils/helpers.d.ts +55 -0
  16. package/dist/utils/helpers.js +19 -0
  17. package/dist/utils/index.d.ts +1 -1
  18. package/dist/utils/index.js +67 -21
  19. package/package.json +76 -50
  20. package/dist/chunk-723HQUNP.js +0 -14
  21. package/dist/chunk-ESFBJFNU.cjs +0 -149
  22. package/dist/chunk-GMT3V67N.cjs +0 -24
  23. package/dist/chunk-HMBBDY5L.cjs +0 -49
  24. package/dist/chunk-JS7W7LMD.cjs +0 -14
  25. package/dist/chunk-KISSHBCD.cjs +0 -1333
  26. package/dist/chunk-LFHG33FO.cjs +0 -313
  27. package/dist/chunk-QSFZU7HX.cjs +0 -47
  28. package/dist/chunk-RTM5LCEB.js +0 -149
  29. package/dist/chunk-USNT2KNT.cjs +0 -6
  30. package/dist/chunk-VIASOXKK.js +0 -1333
  31. package/dist/preset.cjs +0 -988
  32. package/dist/preset.d.cts +0 -7057
  33. package/dist/rules/import.cjs +0 -291
  34. package/dist/rules/import.d.cts +0 -5
  35. package/dist/rules/import.d.ts +0 -5
  36. package/dist/rules/import.js +0 -291
  37. package/dist/rules/jsx-a11y.cjs +0 -341
  38. package/dist/rules/jsx-a11y.d.cts +0 -5
  39. package/dist/rules/jsx-a11y.d.ts +0 -5
  40. package/dist/rules/jsx-a11y.js +0 -341
  41. package/dist/rules/react-hooks.cjs +0 -15
  42. package/dist/rules/react-hooks.d.cts +0 -5
  43. package/dist/rules/react-hooks.d.ts +0 -5
  44. package/dist/rules/react-hooks.js +0 -15
  45. package/dist/rules/react.cjs +0 -689
  46. package/dist/rules/react.d.cts +0 -5
  47. package/dist/rules/react.d.ts +0 -5
  48. package/dist/rules/react.js +0 -689
  49. package/dist/rules/storm.cjs +0 -7
  50. package/dist/rules/storm.d.cts +0 -11
  51. package/dist/rules/storm.d.ts +0 -11
  52. package/dist/rules/storm.js +0 -7
  53. package/dist/rules/ts-docs.cjs +0 -7
  54. package/dist/rules/ts-docs.d.cts +0 -5
  55. package/dist/rules/ts-docs.d.ts +0 -5
  56. package/dist/rules/ts-docs.js +0 -7
  57. package/dist/rules.d.ts +0 -7005
  58. package/dist/utils/banner-plugin.cjs +0 -9
  59. package/dist/utils/banner-plugin.d.cts +0 -6
  60. package/dist/utils/constants.cjs +0 -25
  61. package/dist/utils/constants.d.cts +0 -24
  62. package/dist/utils/create-flat-import-plugin.cjs +0 -20
  63. package/dist/utils/create-flat-import-plugin.d.cts +0 -11
  64. package/dist/utils/create-flat-import-plugin.d.ts +0 -11
  65. package/dist/utils/create-flat-import-plugin.js +0 -20
  66. package/dist/utils/format-config.cjs +0 -7
  67. package/dist/utils/format-config.d.cts +0 -5
  68. package/dist/utils/get-file-banner.cjs +0 -8
  69. package/dist/utils/get-file-banner.d.cts +0 -9
  70. package/dist/utils/ignores.cjs +0 -7
  71. package/dist/utils/ignores.d.cts +0 -3
  72. package/dist/utils/index.cjs +0 -33
  73. package/dist/utils/index.d.cts +0 -4
@@ -1,149 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/utils/constants.ts
2
- var RESTRICTED_SYNTAX = [
3
- {
4
- // ❌ readFile(…, { encoding: … })
5
- selector: "CallExpression[callee.name=/readFileSync|readFile|writeFileSync|writeFile/] > .arguments:last-child[type=ObjectExpression][properties.length=1] Property[key.name=encoding]",
6
- message: "Specify encoding as last argument instead of object with encoding key"
7
- },
8
- {
9
- // ❌ readFile(…, {})
10
- selector: "CallExpression[callee.name=/readFileSync|readFile|writeFileSync|writeFile/] > .arguments:last-child[type=ObjectExpression][properties.length=0]",
11
- message: "Specify encoding as last argument"
12
- },
13
- {
14
- // ❌ readFileSync(…).toString(…)
15
- selector: "CallExpression[callee.name=readFileSync][parent.property.name=toString]",
16
- message: "toString is redundant, specify encoding as last argument"
17
- },
18
- {
19
- // ❌ ….readFile(…, { encoding: … })
20
- selector: "CallExpression[callee.type=MemberExpression][callee.property.name=/readFileSync|readFile|writeFileSync|writeFile/] > .arguments:last-child[type=ObjectExpression][properties.length=1] Property[key.name=encoding]",
21
- message: "Specify encoding as last argument instead of object with encoding key"
22
- },
23
- {
24
- // ❌ ….readFile(…, {})
25
- selector: "CallExpression[callee.type=MemberExpression][callee.property.name=/readFileSync|readFile|writeFileSync|writeFile/] > .arguments:last-child[type=ObjectExpression][properties.length=0]",
26
- message: "Specify encoding as last argument"
27
- },
28
- {
29
- // ❌ Boolean(…)
30
- selector: "CallExpression[callee.name=Boolean][arguments.1.elements.length!=0]",
31
- message: "Prefer `!!\u2026` over `Boolean(\u2026)` because TypeScript infers a narrow literal boolean `type: true` instead of `type: boolean`."
32
- },
33
- {
34
- // ❌ process.browser
35
- selector: "ExpressionStatement[expression.object.name=process][expression.property.name=browser]",
36
- message: "`process.browser` is deprecated, use `!!globalThis.window`"
37
- }
38
- ];
39
- var REACT_RESTRICTED_SYNTAX = [
40
- ...RESTRICTED_SYNTAX,
41
- {
42
- // ❌ useMemo(…, [])
43
- selector: "CallExpression[callee.name=useMemo][arguments.1.type=ArrayExpression][arguments.1.elements.length=0]",
44
- message: "`useMemo` with an empty dependency array can't provide a stable reference, use `useRef` instead."
45
- }
46
- ];
47
- var RESTRICTED_GLOBALS = [
48
- "stop",
49
- {
50
- name: "isNaN",
51
- message: "Use Number.isNaN instead"
52
- }
53
- ];
54
- var RESTRICTED_MODULES = [
55
- {
56
- name: "axios",
57
- message: "Use `fetch/node-fetch` instead."
58
- },
59
- {
60
- name: "moment",
61
- message: "Use `dayjs/date-fns` instead."
62
- },
63
- {
64
- name: "classnames",
65
- message: "Use `clsx` instead because it is faster."
66
- },
67
- {
68
- name: "lodash/isString.js",
69
- message: "Use `typeof yourVar === 'string'` instead."
70
- },
71
- {
72
- name: "lodash/isArray.js",
73
- message: "Use `Array.isArray` instead."
74
- },
75
- {
76
- name: "lodash/flatten.js",
77
- message: "Use `Array#flat()` instead."
78
- },
79
- {
80
- name: "lodash/compact.js",
81
- message: "Use `Array#filter(Boolean)` instead."
82
- },
83
- {
84
- name: "lodash/identity.js",
85
- message: "Use `(value) => value` instead."
86
- }
87
- ];
88
- var JS_FILES = [
89
- "*.js?(x)",
90
- "*.mjs"
91
- ];
92
- var CODE_BLOCK = "**/*.md{,x}/*";
93
- var CODE_FILE = "**/*.{,c,m}{j,t}s{,x}";
94
- var TS_FILE = "**/*.{,c,m}ts{,x}";
95
- var JS_FILE = "**/*.{,c}js{,x}";
96
- var ACRONYMS_LIST = [
97
- "API",
98
- "ASCII",
99
- "CPU",
100
- "CSS",
101
- "DNS",
102
- "EOF",
103
- "GUID",
104
- "HTML",
105
- "HTTP",
106
- "HTTPS",
107
- "ID",
108
- "IP",
109
- "JSON",
110
- "LHS",
111
- "OEM",
112
- "PP",
113
- "QA",
114
- "RAM",
115
- "RHS",
116
- "RPC",
117
- "RSS",
118
- "SLA",
119
- "SMTP",
120
- "SQL",
121
- "SSH",
122
- "SSL",
123
- "TCP",
124
- "TLS",
125
- "TTL",
126
- "UDP",
127
- "UI",
128
- "UID",
129
- "UUID",
130
- "URI",
131
- "URL",
132
- "UTF",
133
- "VM",
134
- "XML",
135
- "XSS"
136
- ];
137
-
138
-
139
-
140
-
141
-
142
-
143
-
144
-
145
-
146
-
147
-
148
-
149
- exports.RESTRICTED_SYNTAX = RESTRICTED_SYNTAX; exports.REACT_RESTRICTED_SYNTAX = REACT_RESTRICTED_SYNTAX; exports.RESTRICTED_GLOBALS = RESTRICTED_GLOBALS; exports.RESTRICTED_MODULES = RESTRICTED_MODULES; exports.JS_FILES = JS_FILES; exports.CODE_BLOCK = CODE_BLOCK; exports.CODE_FILE = CODE_FILE; exports.TS_FILE = TS_FILE; exports.JS_FILE = JS_FILE; exports.ACRONYMS_LIST = ACRONYMS_LIST;
@@ -1,24 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
-
3
- var _chunkUSNT2KNTcjs = require('./chunk-USNT2KNT.cjs');
4
-
5
- // src/utils/format-config.ts
6
- var formatConfig = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (name, config = []) => {
7
- return config.map((config2, index) => {
8
- if (!config2 || config2.name) {
9
- return _nullishCoalesce(config2, () => ( {}));
10
- }
11
- return {
12
- ...config2,
13
- name: `Storm Software (${config2.name ? config2.name : name}) #${index + 1}`,
14
- settings: {
15
- "import/resolver": "node",
16
- ..._nullishCoalesce(config2.settings, () => ( {}))
17
- }
18
- };
19
- });
20
- }, "formatConfig");
21
-
22
-
23
-
24
- exports.formatConfig = formatConfig;
@@ -1,49 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
-
3
- var _chunkESFBJFNUcjs = require('./chunk-ESFBJFNU.cjs');
4
-
5
-
6
- var _chunkUSNT2KNTcjs = require('./chunk-USNT2KNT.cjs');
7
-
8
- // src/utils/get-file-banner.ts
9
- var getFileBanner = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (name = "") => {
10
- if (!name) {
11
- name = process.env.STORM_NAMESPACE || "";
12
- }
13
- let padding = " ";
14
- for (let i = 0; i < name.length + 2 && padding.length > 4; i++) {
15
- padding = padding.slice(0, -1);
16
- }
17
- let titleName = name;
18
- if (titleName) {
19
- if (_optionalChain([titleName, 'optionalAccess', _ => _.startsWith, 'call', _2 => _2("@")])) {
20
- titleName = titleName.slice(1);
21
- }
22
- titleName = (titleName.charAt(0).toUpperCase() + titleName.slice(1)).split("-").filter((word) => word && word.length > 0).map((word) => {
23
- if (_chunkESFBJFNUcjs.ACRONYMS_LIST.includes(word.toUpperCase())) {
24
- return word.toUpperCase();
25
- }
26
- return word.charAt(0).toUpperCase() + word.slice(1);
27
- }).join(" ");
28
- }
29
- return `-------------------------------------------------------------------
30
-
31
- ${padding}\u26A1 Storm Software ${titleName ? `- ${titleName}` : ""}
32
-
33
- This code was released as part of ${titleName ? `the ${titleName}` : "a Storm Software"} project. ${titleName ? titleName : "The project"}
34
- is maintained by Storm Software under the ${_optionalChain([(_nullishCoalesce(process.env.STORM_LICENSE, () => ( "Apache-2.0"))), 'optionalAccess', _3 => _3.toLowerCase, 'call', _4 => _4(), 'optionalAccess', _5 => _5.includes, 'call', _6 => _6("license")]) ? _nullishCoalesce(process.env.STORM_LICENSE, () => ( "Apache-2.0")) : `${_nullishCoalesce(process.env.STORM_LICENSE, () => ( "Apache-2.0"))} License`}, and is
35
- free for commercial and private use. For more information, please visit
36
- our licensing page.
37
-
38
- Website: ${_nullishCoalesce(process.env.STORM_HOMEPAGE, () => ( "https://stormsoftware.com"))}
39
- Repository: ${_nullishCoalesce(process.env.STORM_REPOSITORY, () => ( `https://github.com/storm-software${name ? `/${name}` : ""}`))}
40
- Documentation: ${process.env.STORM_DOCS ? process.env.STORM_DOCS : `https://stormsoftware.com/${name ? `projects/${name}/` : ""}docs`}
41
- Contact: ${process.env.STORM_HOMEPAGE ? process.env.STORM_HOMEPAGE.endsWith("/") ? process.env.STORM_HOMEPAGE.slice(-1) : process.env.STORM_HOMEPAGE : "https://stormsoftware.com"}/contact
42
- License: ${process.env.STORM_LICENSING ? process.env.STORM_LICENSING : `https://stormsoftware.com/${name ? `projects/${name}/` : ""}license`}
43
-
44
- -------------------------------------------------------------------`;
45
- }, "getFileBanner");
46
-
47
-
48
-
49
- exports.getFileBanner = getFileBanner;
@@ -1,14 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/rules/ts-docs.ts
2
- var config = {
3
- /**
4
- * Require TSDoc comments conform to the TSDoc specification.
5
- *
6
- * 🚫 Not fixable - https://github.com/microsoft/tsdoc/tree/master/eslint-plugin
7
- */
8
- "tsdoc/syntax": "warn"
9
- };
10
- var ts_docs_default = config;
11
-
12
-
13
-
14
- exports.ts_docs_default = ts_docs_default;