@storm-software/eslint 0.82.0 → 0.83.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/README.md +1 -1
- package/dist/preset.mjs +104 -88
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ This package is part of the <b>⚡Storm-Ops</b> monorepo. The Storm-Ops packages
|
|
|
21
21
|
|
|
22
22
|
<h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
|
|
23
23
|
|
|
24
|
-
[](https://prettier.io/) [](http://nx.dev/) [](https://nextjs.org/) [](http://commitizen.github.io/cz-cli/)  [](https://fumadocs.vercel.app/) 
|
|
25
25
|
|
|
26
26
|
<!-- prettier-ignore-start -->
|
|
27
27
|
<!-- markdownlint-disable -->
|
package/dist/preset.mjs
CHANGED
|
@@ -12845,29 +12845,24 @@ const plugin = {
|
|
|
12845
12845
|
},
|
|
12846
12846
|
processors: {}
|
|
12847
12847
|
};
|
|
12848
|
-
plugin.configs && (plugin.configs.recommended =
|
|
12849
|
-
|
|
12850
|
-
|
|
12851
|
-
|
|
12852
|
-
|
|
12853
|
-
|
|
12854
|
-
|
|
12855
|
-
|
|
12856
|
-
|
|
12857
|
-
|
|
12858
|
-
|
|
12859
|
-
|
|
12860
|
-
|
|
12861
|
-
|
|
12862
|
-
|
|
12863
|
-
|
|
12864
|
-
"!**/.nx/**/*"
|
|
12865
|
-
],
|
|
12866
|
-
rules: {
|
|
12867
|
-
"banner/banner": ["error", { commentType: "block", numNewlines: 2 }]
|
|
12868
|
-
}
|
|
12848
|
+
plugin.configs && (plugin.configs.recommended = {
|
|
12849
|
+
name: "banner/recommended",
|
|
12850
|
+
plugins: { banner: plugin },
|
|
12851
|
+
files: [
|
|
12852
|
+
CODE_FILE,
|
|
12853
|
+
"!**/docs/**/*",
|
|
12854
|
+
"!**/crates/**/*",
|
|
12855
|
+
"!**/tmp/**/*",
|
|
12856
|
+
"!**/dist/**/*",
|
|
12857
|
+
"!**/coverage/**/*",
|
|
12858
|
+
"!**/node_modules/**/*",
|
|
12859
|
+
"!**/.cache/**/*",
|
|
12860
|
+
"!**/.nx/**/*"
|
|
12861
|
+
],
|
|
12862
|
+
rules: {
|
|
12863
|
+
"banner/banner": ["error", { commentType: "block", numNewlines: 2 }]
|
|
12869
12864
|
}
|
|
12870
|
-
|
|
12865
|
+
});
|
|
12871
12866
|
|
|
12872
12867
|
const formatConfig = (name, config = []) => {
|
|
12873
12868
|
return config.map((config2, index) => {
|
|
@@ -12890,17 +12885,18 @@ function getStormConfig(options = {
|
|
|
12890
12885
|
ignores: [],
|
|
12891
12886
|
tsconfig: "./tsconfig.base.json",
|
|
12892
12887
|
parserOptions: {},
|
|
12888
|
+
tsConfigType: "eslint-recommended",
|
|
12889
|
+
useUnicorn: true,
|
|
12893
12890
|
markdown: {},
|
|
12894
12891
|
react: {},
|
|
12895
12892
|
useReactCompiler: false
|
|
12896
12893
|
}, ...userConfigs) {
|
|
12894
|
+
const tsconfig = options.tsconfig ?? "./tsconfig.base.json";
|
|
12897
12895
|
const tsConfigType = options.tsConfigType || "eslint-recommended";
|
|
12898
12896
|
const useUnicorn = options.useUnicorn ?? true;
|
|
12899
12897
|
const react = options.react ?? {};
|
|
12900
12898
|
const useReactCompiler = options.useReactCompiler ?? false;
|
|
12901
12899
|
const configs = [
|
|
12902
|
-
// https://eslint.org/docs/latest/rules/
|
|
12903
|
-
eslint.configs.recommended,
|
|
12904
12900
|
// Prettier
|
|
12905
12901
|
prettierConfig,
|
|
12906
12902
|
// Import
|
|
@@ -12912,13 +12908,14 @@ function getStormConfig(options = {
|
|
|
12912
12908
|
// },
|
|
12913
12909
|
// Banner
|
|
12914
12910
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
12915
|
-
...plugin.configs["recommended"],
|
|
12916
|
-
// TSDoc
|
|
12917
|
-
// https://www.npmjs.com/package/eslint-plugin-tsdoc
|
|
12918
12911
|
{
|
|
12919
|
-
|
|
12920
|
-
|
|
12921
|
-
|
|
12912
|
+
...plugin.configs["recommended"],
|
|
12913
|
+
rules: {
|
|
12914
|
+
"banner/banner": [
|
|
12915
|
+
"error",
|
|
12916
|
+
{ commentType: "block", numNewlines: 2, repositoryName: options.name }
|
|
12917
|
+
]
|
|
12918
|
+
}
|
|
12922
12919
|
},
|
|
12923
12920
|
// NX
|
|
12924
12921
|
{
|
|
@@ -12983,75 +12980,94 @@ function getStormConfig(options = {
|
|
|
12983
12980
|
// User overrides
|
|
12984
12981
|
...userConfigs
|
|
12985
12982
|
].filter(Boolean);
|
|
12983
|
+
const typescriptConfigs = [
|
|
12984
|
+
eslint.configs.recommended
|
|
12985
|
+
];
|
|
12986
12986
|
if (tsConfigType !== "none") {
|
|
12987
|
-
configs
|
|
12988
|
-
|
|
12989
|
-
|
|
12990
|
-
|
|
12991
|
-
|
|
12992
|
-
|
|
12993
|
-
|
|
12987
|
+
if (!(tsConfigType in tsEslint$1.configs)) {
|
|
12988
|
+
console.warn(
|
|
12989
|
+
"Invalid TypeScript ESLint configuration type:",
|
|
12990
|
+
tsConfigType
|
|
12991
|
+
);
|
|
12992
|
+
} else {
|
|
12993
|
+
typescriptConfigs.push(
|
|
12994
|
+
...tsEslint$1.configs[tsConfigType]?.map((config) => ({
|
|
12995
|
+
...config,
|
|
12996
|
+
files: [TS_FILE]
|
|
12997
|
+
})) ?? []
|
|
12998
|
+
);
|
|
12999
|
+
}
|
|
12994
13000
|
}
|
|
12995
13001
|
if (useUnicorn) {
|
|
12996
|
-
|
|
13002
|
+
typescriptConfigs.push({
|
|
12997
13003
|
plugins: { unicorn },
|
|
12998
13004
|
rules: {
|
|
12999
13005
|
...unicorn.configs["flat/recommended"].rules
|
|
13000
13006
|
}
|
|
13001
13007
|
});
|
|
13002
13008
|
}
|
|
13003
|
-
|
|
13009
|
+
typescriptConfigs.push({
|
|
13004
13010
|
files: [TS_FILE],
|
|
13005
|
-
|
|
13006
|
-
|
|
13007
|
-
|
|
13008
|
-
|
|
13009
|
-
|
|
13010
|
-
|
|
13011
|
-
|
|
13012
|
-
|
|
13013
|
-
|
|
13014
|
-
|
|
13015
|
-
|
|
13016
|
-
|
|
13017
|
-
|
|
13018
|
-
|
|
13011
|
+
plugins: { tsdoc },
|
|
13012
|
+
rules: config
|
|
13013
|
+
});
|
|
13014
|
+
typescriptConfigs.push(
|
|
13015
|
+
...plugin.configs["recommended"]
|
|
13016
|
+
);
|
|
13017
|
+
configs.push(
|
|
13018
|
+
...tsEslint$1.config({
|
|
13019
|
+
files: [TS_FILE],
|
|
13020
|
+
extends: typescriptConfigs,
|
|
13021
|
+
languageOptions: {
|
|
13022
|
+
globals: {
|
|
13023
|
+
...Object.fromEntries(
|
|
13024
|
+
Object.keys(globals).flatMap(
|
|
13025
|
+
(group) => Object.keys(globals[group]).map((key) => [
|
|
13026
|
+
key,
|
|
13027
|
+
"readonly"
|
|
13028
|
+
])
|
|
13029
|
+
)
|
|
13030
|
+
),
|
|
13031
|
+
...globals.browser,
|
|
13032
|
+
...globals.node,
|
|
13033
|
+
"window": "readonly",
|
|
13034
|
+
"Storm": "readonly"
|
|
13035
|
+
},
|
|
13036
|
+
parserOptions: {
|
|
13037
|
+
emitDecoratorMetadata: true,
|
|
13038
|
+
experimentalDecorators: true,
|
|
13039
|
+
project: tsconfig,
|
|
13040
|
+
projectService: true,
|
|
13041
|
+
sourceType: "module",
|
|
13042
|
+
projectFolderIgnoreList: [
|
|
13043
|
+
"**/node_modules/**",
|
|
13044
|
+
"**/dist/**",
|
|
13045
|
+
"**/coverage/**",
|
|
13046
|
+
"**/tmp/**",
|
|
13047
|
+
"**/.nx/**",
|
|
13048
|
+
"**/.tamagui/**",
|
|
13049
|
+
"**/.next/**",
|
|
13050
|
+
...options.ignores || []
|
|
13051
|
+
],
|
|
13052
|
+
...options.parserOptions
|
|
13053
|
+
}
|
|
13019
13054
|
},
|
|
13020
|
-
|
|
13021
|
-
|
|
13022
|
-
|
|
13023
|
-
|
|
13024
|
-
|
|
13025
|
-
|
|
13026
|
-
|
|
13027
|
-
|
|
13028
|
-
|
|
13029
|
-
|
|
13030
|
-
|
|
13031
|
-
|
|
13032
|
-
|
|
13033
|
-
|
|
13034
|
-
|
|
13035
|
-
|
|
13036
|
-
...options.parserOptions
|
|
13037
|
-
}
|
|
13038
|
-
},
|
|
13039
|
-
rules: {
|
|
13040
|
-
...getStormRulesConfig({ ...options, tsConfigType, useUnicorn }),
|
|
13041
|
-
...options.rules ?? {}
|
|
13042
|
-
},
|
|
13043
|
-
ignores: [
|
|
13044
|
-
"**/node_modules/**",
|
|
13045
|
-
"**/dist/**",
|
|
13046
|
-
"**/coverage/**",
|
|
13047
|
-
"**/tmp/**",
|
|
13048
|
-
"**/.nx/**",
|
|
13049
|
-
"**/.tamagui/**",
|
|
13050
|
-
"**/.next/**",
|
|
13051
|
-
...options.ignores || []
|
|
13052
|
-
]
|
|
13053
|
-
};
|
|
13054
|
-
configs.push(typescriptConfig);
|
|
13055
|
+
rules: {
|
|
13056
|
+
...getStormRulesConfig({ ...options, tsConfigType, useUnicorn }),
|
|
13057
|
+
...options.rules ?? {}
|
|
13058
|
+
},
|
|
13059
|
+
ignores: [
|
|
13060
|
+
"**/node_modules/**",
|
|
13061
|
+
"**/dist/**",
|
|
13062
|
+
"**/coverage/**",
|
|
13063
|
+
"**/tmp/**",
|
|
13064
|
+
"**/.nx/**",
|
|
13065
|
+
"**/.tamagui/**",
|
|
13066
|
+
"**/.next/**",
|
|
13067
|
+
...options.ignores || []
|
|
13068
|
+
]
|
|
13069
|
+
})
|
|
13070
|
+
);
|
|
13055
13071
|
if (react) {
|
|
13056
13072
|
const reactConfigs = [
|
|
13057
13073
|
{
|
package/package.json
CHANGED