@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 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
- [![Version](https://img.shields.io/badge/version-0.81.0-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with Fumadocs](https://img.shields.io/badge/documented_with-fumadocs-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://fumadocs.vercel.app/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/storm-ops/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
24
+ [![Version](https://img.shields.io/badge/version-0.83.0-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with Fumadocs](https://img.shields.io/badge/documented_with-fumadocs-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://fumadocs.vercel.app/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/storm-ops/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
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
- name: "banner/recommended/plugin",
12851
- plugins: { banner: plugin }
12852
- },
12853
- {
12854
- name: "banner/recommended/code-files",
12855
- files: [
12856
- CODE_FILE,
12857
- "!**/docs/**/*",
12858
- "!**/crates/**/*",
12859
- "!**/tmp/**/*",
12860
- "!**/dist/**/*",
12861
- "!**/coverage/**/*",
12862
- "!**/node_modules/**/*",
12863
- "!**/.cache/**/*",
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
- files: [TS_FILE],
12920
- plugins: { tsdoc },
12921
- rules: config
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.push(
12988
- ...tsEslint$1.configs[tsConfigType]?.map((config) => ({
12989
- ...config,
12990
- files: [TS_FILE]
12991
- // We use TS config only for TS files
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
- configs.push({
13002
+ typescriptConfigs.push({
12997
13003
  plugins: { unicorn },
12998
13004
  rules: {
12999
13005
  ...unicorn.configs["flat/recommended"].rules
13000
13006
  }
13001
13007
  });
13002
13008
  }
13003
- const typescriptConfig = {
13009
+ typescriptConfigs.push({
13004
13010
  files: [TS_FILE],
13005
- languageOptions: {
13006
- globals: {
13007
- ...Object.fromEntries(
13008
- Object.keys(globals).flatMap(
13009
- (group) => Object.keys(globals[group]).map((key) => [
13010
- key,
13011
- "readonly"
13012
- ])
13013
- )
13014
- ),
13015
- ...globals.browser,
13016
- ...globals.node,
13017
- "window": "readonly",
13018
- "Storm": "readonly"
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
- parserOptions: {
13021
- emitDecoratorMetadata: true,
13022
- experimentalDecorators: true,
13023
- project: options.tsconfig ? options.tsconfig : "./tsconfig.base.json",
13024
- projectService: true,
13025
- sourceType: "module",
13026
- projectFolderIgnoreList: [
13027
- "**/node_modules/**",
13028
- "**/dist/**",
13029
- "**/coverage/**",
13030
- "**/tmp/**",
13031
- "**/.nx/**",
13032
- "**/.tamagui/**",
13033
- "**/.next/**",
13034
- ...options.ignores || []
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storm-software/eslint",
3
- "version": "0.82.0",
3
+ "version": "0.83.1",
4
4
  "type": "module",
5
5
  "description": "⚡ A package containing the base ESLint configuration used by Storm Software across many projects.",
6
6
  "repository": {