@storm-software/eslint 0.98.0 → 0.100.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.
package/dist/preset.d.mts CHANGED
@@ -7027,6 +7027,10 @@ type PresetModuleBoundary = {
7027
7027
  allow: any[];
7028
7028
  depConstraints: PresetModuleBoundaryDepConstraints[];
7029
7029
  };
7030
+ /**
7031
+ * The ESLint globals property value.
7032
+ */
7033
+ type ESLintGlobalsPropValue = boolean | "readonly" | "readable" | "writable" | "writeable";
7030
7034
  /**
7031
7035
  * The ESLint preset options.
7032
7036
  */
@@ -7035,6 +7039,7 @@ type PresetOptions = GetStormRulesConfigOptions & {
7035
7039
  banner?: string;
7036
7040
  rules?: RuleOptions;
7037
7041
  ignores?: string[];
7042
+ globals?: Record<string, ESLintGlobalsPropValue>;
7038
7043
  tsconfig?: string;
7039
7044
  typescriptEslintConfigType?: string;
7040
7045
  parserOptions?: Linter.ParserOptions;
@@ -7053,4 +7058,4 @@ type PresetOptions = GetStormRulesConfigOptions & {
7053
7058
  */
7054
7059
  declare function getStormConfig(options?: PresetOptions, ...userConfigs: Linter.FlatConfig[]): Linter.FlatConfig<Linter.RulesRecord>[];
7055
7060
 
7056
- export { type PresetModuleBoundary, type PresetModuleBoundaryDepConstraints, type PresetOptions, getStormConfig };
7061
+ export { type ESLintGlobalsPropValue, type PresetModuleBoundary, type PresetModuleBoundaryDepConstraints, type PresetOptions, getStormConfig };
package/dist/preset.d.ts CHANGED
@@ -7027,6 +7027,10 @@ type PresetModuleBoundary = {
7027
7027
  allow: any[];
7028
7028
  depConstraints: PresetModuleBoundaryDepConstraints[];
7029
7029
  };
7030
+ /**
7031
+ * The ESLint globals property value.
7032
+ */
7033
+ type ESLintGlobalsPropValue = boolean | "readonly" | "readable" | "writable" | "writeable";
7030
7034
  /**
7031
7035
  * The ESLint preset options.
7032
7036
  */
@@ -7035,6 +7039,7 @@ type PresetOptions = GetStormRulesConfigOptions & {
7035
7039
  banner?: string;
7036
7040
  rules?: RuleOptions;
7037
7041
  ignores?: string[];
7042
+ globals?: Record<string, ESLintGlobalsPropValue>;
7038
7043
  tsconfig?: string;
7039
7044
  typescriptEslintConfigType?: string;
7040
7045
  parserOptions?: Linter.ParserOptions;
@@ -7053,4 +7058,4 @@ type PresetOptions = GetStormRulesConfigOptions & {
7053
7058
  */
7054
7059
  declare function getStormConfig(options?: PresetOptions, ...userConfigs: Linter.FlatConfig[]): Linter.FlatConfig<Linter.RulesRecord>[];
7055
7060
 
7056
- export { type PresetModuleBoundary, type PresetModuleBoundaryDepConstraints, type PresetOptions, getStormConfig };
7061
+ export { type ESLintGlobalsPropValue, type PresetModuleBoundary, type PresetModuleBoundaryDepConstraints, type PresetOptions, getStormConfig };
package/dist/preset.mjs CHANGED
@@ -17,7 +17,7 @@ import storybookPlugin from 'eslint-plugin-storybook';
17
17
  import tsdoc from 'eslint-plugin-tsdoc';
18
18
  import unicorn from 'eslint-plugin-unicorn';
19
19
  import yml from 'eslint-plugin-yml';
20
- import globals from 'globals';
20
+ import globalsObj from 'globals';
21
21
  import { writeInfo, writeDebug, formatLogMessage, writeFatal, writeError } from '@storm-software/config-tools';
22
22
  import { defu } from 'defu';
23
23
  import tsEslint$1 from 'typescript-eslint';
@@ -12926,6 +12926,7 @@ const ignores = [
12926
12926
  function getStormConfig(options = {
12927
12927
  rules: {},
12928
12928
  ignores: [],
12929
+ globals: {},
12929
12930
  useUnicorn: true,
12930
12931
  markdown: {},
12931
12932
  react: {},
@@ -12942,6 +12943,7 @@ function getStormConfig(options = {
12942
12943
  const nx = options.nx ?? {};
12943
12944
  const useReactCompiler = options.useReactCompiler ?? false;
12944
12945
  const logLevel = options.logLevel ?? "info";
12946
+ const globals = options.globals ?? {};
12945
12947
  try {
12946
12948
  const configs = [
12947
12949
  // Prettier
@@ -13103,19 +13105,16 @@ function getStormConfig(options = {
13103
13105
  languageOptions: {
13104
13106
  globals: {
13105
13107
  ...Object.fromEntries(
13106
- Object.keys(globals).flatMap(
13107
- (group) => Object.keys(globals[group]).map((key) => [
13108
- key,
13109
- "readonly"
13110
- ])
13108
+ Object.keys(globalsObj).flatMap(
13109
+ (group) => Object.keys(globalsObj[group]).map(
13110
+ (key) => [key, "readonly"]
13111
+ )
13111
13112
  )
13112
13113
  ),
13113
- ...globals.browser,
13114
- ...globals.node,
13115
- "window": "readonly",
13116
- "STORM_ENV_CONTEXT": "readonly",
13117
- "STORM_ENV_CONTEXT_PUBLIC": "readonly",
13118
- "__STORM_INJECTION_STORE__": "readonly"
13114
+ ...globalsObj.browser,
13115
+ ...globalsObj.node,
13116
+ ...globals,
13117
+ "window": "readonly"
13119
13118
  },
13120
13119
  parserOptions: {
13121
13120
  projectService: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storm-software/eslint",
3
- "version": "0.98.0",
3
+ "version": "0.100.0",
4
4
  "type": "module",
5
5
  "description": "⚡ A package containing the base ESLint configuration used by Storm Software across many projects.",
6
6
  "repository": {