@storm-software/eslint 0.126.1 → 0.126.2

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/dist/preset.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Linter } from 'eslint';
2
2
  import { FlatConfigComposer } from 'eslint-flat-config-utils';
3
- import { O as OptionsConfig, R as RuleOptions, T as TypedFlatConfigItem, A as Awaitable, C as ConfigNames } from './types-CadFhnVH.js';
3
+ import { O as OptionsConfig, R as RuleOptions, T as TypedFlatConfigItem, A as Awaitable, C as ConfigNames } from './types-CnDDaY3J.js';
4
4
  import '@nx/eslint-plugin/src/utils/runtime-lint-utils';
5
5
  import '@stylistic/eslint-plugin';
6
6
  import '@typescript-eslint/parser';
package/dist/preset.js CHANGED
@@ -769,9 +769,10 @@ import { default as default2 } from "@cspell/eslint-plugin";
769
769
  import { default as default3 } from "@nx/eslint-plugin/nx.js";
770
770
  import * as pluginImport from "eslint-plugin-import-x";
771
771
  import { default as default4 } from "eslint-plugin-n";
772
- import { default as default5 } from "eslint-plugin-perfectionist";
773
- import { default as default6 } from "eslint-plugin-unicorn";
774
- import { default as default7 } from "eslint-plugin-unused-imports";
772
+ import { default as default5 } from "eslint-plugin-no-secrets";
773
+ import { default as default6 } from "eslint-plugin-perfectionist";
774
+ import { default as default7 } from "eslint-plugin-unicorn";
775
+ import { default as default8 } from "eslint-plugin-unused-imports";
775
776
 
776
777
  // src/configs/imports.ts
777
778
  async function imports(options = {}) {
@@ -860,7 +861,7 @@ async function javascript(options = {}) {
860
861
  {
861
862
  name: "storm/javascript/rules",
862
863
  plugins: {
863
- "unused-imports": default7
864
+ "unused-imports": default8
864
865
  },
865
866
  rules: {
866
867
  // disallow use of console
@@ -2558,7 +2559,7 @@ async function nx(options = {}) {
2558
2559
  "@nx/enforce-module-boundaries": [
2559
2560
  "error",
2560
2561
  moduleBoundaries ?? {
2561
- enforceBuildableLibDependency: true,
2562
+ enforceBuildableLibDependency: false,
2562
2563
  checkDynamicDependenciesExceptions: [
2563
2564
  ".*"
2564
2565
  ],
@@ -2583,9 +2584,9 @@ __name(nx, "nx");
2583
2584
  async function perfectionist() {
2584
2585
  return [
2585
2586
  {
2586
- name: "storm/perfectionist/setup",
2587
+ name: "storm/perfectionist/rules",
2587
2588
  plugins: {
2588
- perfectionist: default5
2589
+ perfectionist: default6
2589
2590
  },
2590
2591
  rules: {
2591
2592
  "perfectionist/sort-exports": [
@@ -2843,6 +2844,13 @@ async function regexp(options = {}) {
2843
2844
  name: "storm/regexp/rules",
2844
2845
  rules: {
2845
2846
  ...rules,
2847
+ "regexp/no-unused-capturing-group": [
2848
+ "error",
2849
+ {
2850
+ fixable: true,
2851
+ allowNamed: false
2852
+ }
2853
+ ],
2846
2854
  ...options.overrides
2847
2855
  }
2848
2856
  }
@@ -3539,10 +3547,10 @@ async function unicorn(options = {}) {
3539
3547
  {
3540
3548
  name: "storm/unicorn/rules",
3541
3549
  plugins: {
3542
- unicorn: default6
3550
+ unicorn: default7
3543
3551
  },
3544
3552
  rules: {
3545
- ...options.allRecommended ? default6.configs["recommended"].rules : {
3553
+ ...options.allRecommended ? default7.configs["recommended"].rules : {
3546
3554
  "unicorn/consistent-empty-array-spread": "error",
3547
3555
  "unicorn/error-message": "error",
3548
3556
  "unicorn/escape-case": "error",
@@ -3734,6 +3742,81 @@ async function mdx(options = {}) {
3734
3742
  }
3735
3743
  __name(mdx, "mdx");
3736
3744
 
3745
+ // src/configs/react-native.ts
3746
+ import { FlatCompat as FlatCompat3 } from "@eslint/eslintrc";
3747
+ var compat3 = new FlatCompat3({
3748
+ // import.meta.dirname is available after Node.js v20.11.0
3749
+ baseDirectory: import.meta.dirname
3750
+ });
3751
+ async function reactNative(options = {}) {
3752
+ const { overrides = {} } = options;
3753
+ await ensurePackages([
3754
+ "eslint-plugin-react-native"
3755
+ ]);
3756
+ const reactNative1 = await interopDefault(
3757
+ // eslint-disable-next-line @nx/enforce-module-boundaries
3758
+ import("eslint-plugin-react-native")
3759
+ );
3760
+ return [
3761
+ ...compat3.config({
3762
+ name: "storm/react-native/rules",
3763
+ parserOptions: {
3764
+ ecmaFeatures: {
3765
+ "jsx": true
3766
+ }
3767
+ },
3768
+ env: {
3769
+ "react-native/react-native": true
3770
+ },
3771
+ plugins: [
3772
+ "react-native"
3773
+ ],
3774
+ extends: [
3775
+ "plugin:react-native/all"
3776
+ ],
3777
+ rules: {
3778
+ ...reactNative1.configs.all.rules,
3779
+ ...overrides
3780
+ }
3781
+ })
3782
+ ];
3783
+ }
3784
+ __name(reactNative, "reactNative");
3785
+
3786
+ // src/configs/secrets.ts
3787
+ async function secrets(options) {
3788
+ const { json = true } = options;
3789
+ await ensurePackages([
3790
+ "eslint-plugin-jsonc"
3791
+ ]);
3792
+ const [pluginJsonc] = await Promise.all([
3793
+ interopDefault(import("eslint-plugin-jsonc"))
3794
+ ]);
3795
+ return [
3796
+ ...json ? pluginJsonc.configs["flat/recommended-with-jsonc"] : [],
3797
+ {
3798
+ name: "storm/secrets/rules",
3799
+ files: [
3800
+ `**/*.{js,ts,jsx,tsx${json ? ",json,jsonc" : ""}`
3801
+ ],
3802
+ plugins: {
3803
+ "no-secrets": default5
3804
+ },
3805
+ rules: {
3806
+ "no-secrets/no-secrets": [
3807
+ "error",
3808
+ {
3809
+ "ignoreIdentifiers": [
3810
+ "nxCloudId"
3811
+ ]
3812
+ }
3813
+ ]
3814
+ }
3815
+ }
3816
+ ];
3817
+ }
3818
+ __name(secrets, "secrets");
3819
+
3737
3820
  // src/preset.ts
3738
3821
  var flatConfigProps = [
3739
3822
  "name",
@@ -3766,7 +3849,7 @@ function getOverrides(options, key) {
3766
3849
  }
3767
3850
  __name(getOverrides, "getOverrides");
3768
3851
  function getStormConfig(options, ...userConfigs) {
3769
- const { name = "", globals = {}, lineEndings = "unix", astro: enableAstro = false, autoRenamePlugins = true, componentExts = [], gitignore: enableGitignore = true, jsx: enableJsx = true, cspell: enableCSpell = true, react: enableReact = false, regexp: enableRegexp = true, next: enableNext = false, graphql: enableGraphQL = false, storybook: enableStorybook = false, typescript: enableTypeScript = isPackageExists2("typescript"), unicorn: enableUnicorn = true, unocss: enableUnoCSS = false } = options;
3852
+ const { name = "", globals = {}, lineEndings = "unix", astro: enableAstro = false, autoRenamePlugins = true, componentExts = [], gitignore: enableGitignore = true, jsx: enableJsx = true, cspell: enableCSpell = true, react: enableReact = false, "react-native": enableReactNative = false, regexp: enableRegexp = true, next: enableNext = false, graphql: enableGraphQL = false, storybook: enableStorybook = false, typescript: enableTypeScript = isPackageExists2("typescript"), unicorn: enableUnicorn = true, unocss: enableUnoCSS = false } = options;
3770
3853
  let isInEditor = options.isInEditor;
3771
3854
  if (isInEditor == null) {
3772
3855
  isInEditor = isInEditorEnv();
@@ -3808,7 +3891,9 @@ function getStormConfig(options, ...userConfigs) {
3808
3891
  stylistic: stylisticOptions
3809
3892
  }), imports({
3810
3893
  stylistic: stylisticOptions
3811
- }), nx(resolveSubOptions(options, "nx")), perfectionist());
3894
+ }), nx(resolveSubOptions(options, "nx")), perfectionist(), secrets({
3895
+ json: options.jsonc !== false
3896
+ }));
3812
3897
  if (enableCSpell) {
3813
3898
  configs2.push(cspell(resolveSubOptions(options, "cspell")));
3814
3899
  }
@@ -3853,6 +3938,12 @@ function getStormConfig(options, ...userConfigs) {
3853
3938
  tsconfigPath
3854
3939
  }));
3855
3940
  }
3941
+ if (enableReactNative) {
3942
+ configs2.push(reactNative({
3943
+ ...resolveSubOptions(options, "react-native"),
3944
+ overrides: getOverrides(options, "react-native")
3945
+ }));
3946
+ }
3856
3947
  if (enableNext) {
3857
3948
  configs2.push(next(resolveSubOptions(options, "next")));
3858
3949
  }
@@ -14639,7 +14639,7 @@ type Yoda = []|[("always" | "never")]|[("always" | "never"), {
14639
14639
  onlyEquality?: boolean
14640
14640
  }]
14641
14641
  // Names of all the configs
14642
- type ConfigNames = 'storm/astro/setup' | 'storm/astro/rules' | 'storm/formatter/setup' | 'storm/imports/rules' | 'storm/javascript/setup' | 'storm/javascript/banner' | 'storm/javascript/rules' | 'storm/jsx/rules' | 'storm/jsdoc/rules' | 'storm/jsonc/setup' | 'storm/jsonc/rules' | 'storm/markdown/setup' | 'storm/markdown/processor' | 'storm/markdown/parser' | 'storm/markdown/disables' | 'storm/node/rules' | 'storm/perfectionist/setup' | 'storm/react/setup' | 'storm/react/rules' | 'storm/sort/package-json' | 'storm/stylistic/rules' | 'storm/test/setup' | 'storm/test/rules' | 'storm/toml/setup' | 'storm/toml/rules' | 'storm/regexp/rules' | 'storm/typescript/setup' | 'storm/typescript/parser' | 'storm/typescript/type-aware-parser' | 'storm/typescript/rules' | 'storm/typescript/rules-type-aware' | 'storm/unicorn/rules' | 'storm/unocss' | 'storm/yaml/setup' | 'storm/yaml/rules'
14642
+ type ConfigNames = 'storm/astro/setup' | 'storm/astro/rules' | 'storm/formatter/setup' | 'storm/imports/rules' | 'storm/javascript/setup' | 'storm/javascript/banner' | 'storm/javascript/rules' | 'storm/jsx/rules' | 'storm/jsdoc/rules' | 'storm/jsonc/setup' | 'storm/jsonc/rules' | 'storm/markdown/setup' | 'storm/markdown/processor' | 'storm/markdown/parser' | 'storm/markdown/disables' | 'storm/node/rules' | 'storm/perfectionist/rules' | 'storm/react/setup' | 'storm/react/rules' | 'storm/sort/package-json' | 'storm/stylistic/rules' | 'storm/test/setup' | 'storm/test/rules' | 'storm/toml/setup' | 'storm/toml/rules' | 'storm/regexp/rules' | 'storm/typescript/setup' | 'storm/typescript/parser' | 'storm/typescript/type-aware-parser' | 'storm/typescript/rules' | 'storm/typescript/rules-type-aware' | 'storm/unicorn/rules' | 'storm/unocss' | 'storm/yaml/setup' | 'storm/yaml/rules'
14643
14643
 
14644
14644
  /**
14645
14645
  * Vendor types from Prettier so we don't rely on the dependency.
@@ -15243,6 +15243,15 @@ interface OptionsConfig extends OptionsComponentExts, OptionsJavascript, Options
15243
15243
  * @default false
15244
15244
  */
15245
15245
  react?: boolean | OptionsOverrides;
15246
+ /**
15247
+ * Enable react native rules.
15248
+ *
15249
+ * Requires installing:
15250
+ * - `eslint-plugin-react-native`
15251
+ *
15252
+ * @default false
15253
+ */
15254
+ "react-native"?: boolean | OptionsOverrides;
15246
15255
  /**
15247
15256
  * Enable next rules.
15248
15257
  *
@@ -1,5 +1,5 @@
1
1
  import { Awaitable } from 'eslint-flat-config-utils';
2
- import { T as TypedFlatConfigItem } from '../types-CadFhnVH.js';
2
+ import { T as TypedFlatConfigItem } from '../types-CnDDaY3J.js';
3
3
  import '@nx/eslint-plugin/src/utils/runtime-lint-utils';
4
4
  import '@stylistic/eslint-plugin';
5
5
  import '@typescript-eslint/parser';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storm-software/eslint",
3
- "version": "0.126.1",
3
+ "version": "0.126.2",
4
4
  "type": "module",
5
5
  "description": "⚡ A package containing the base ESLint configuration used by Storm Software across many projects.",
6
6
  "repository": {
@@ -140,6 +140,7 @@
140
140
  "eslint-plugin-format": ">=0.1.0",
141
141
  "eslint-plugin-react-compiler": "19.0.0-beta-21e868a-20250216",
142
142
  "eslint-plugin-react-hooks": "^5.0.0",
143
+ "eslint-plugin-react-native": "^5.0.0",
143
144
  "eslint-plugin-react-refresh": "^0.4.4",
144
145
  "eslint-plugin-relay": "^1.8.3",
145
146
  "eslint-plugin-storybook": "^0.11.0",
@@ -175,6 +176,7 @@
175
176
  "eslint-plugin-mdx": "^3.1.5",
176
177
  "eslint-plugin-n": "^17.8.1",
177
178
  "eslint-plugin-no-only-tests": "^3.3.0",
179
+ "eslint-plugin-no-secrets": "^2.2.1",
178
180
  "eslint-plugin-perfectionist": "^4.9.0",
179
181
  "eslint-plugin-prettier": "^5.2.3",
180
182
  "eslint-plugin-regexp": "^2.7.0",
@@ -211,6 +213,7 @@
211
213
  "eslint-plugin-format": "^1.0.1",
212
214
  "eslint-plugin-react-compiler": "19.0.0-beta-21e868a-20250216",
213
215
  "eslint-plugin-react-hooks": "^5.1.0",
216
+ "eslint-plugin-react-native": "^5.0.0",
214
217
  "eslint-plugin-react-refresh": "^0.4.19",
215
218
  "eslint-plugin-relay": "^1.8.3",
216
219
  "eslint-plugin-storybook": "^0.11.0",