@open-xchange/linter-presets 1.28.0 → 1.29.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/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## `1.29.1` – 2026-Aug-06
4
+
5
+ - fixed: (StyleLint) import all plugins and configs explicitly to avoid needing to hoist the packages in pnpm environments
6
+
7
+ ## `1.29.0` – 2026-Aug-06
8
+
9
+ - added: (ESLint) new option 'refHooks' for `env.react`
10
+ - fixed: (StyleLint) import `@stylistic/stylelint-config` explicitly to avoid needing to hoist the package in pnpm environments
11
+ - fixed: (StyleLint) move call of `stylelint-config-standard-vue` into override config to avoid needing to always hoist the package in pnpm environments
12
+ - chore: bump dependencies
13
+
3
14
  ## `1.28.0` – 2026-Aug-04
4
15
 
5
16
  - changed: (StyleLint) drop unmaintained `stylelint-plugin-license-header`, replace with local rule `license-header/header`
@@ -451,17 +451,25 @@ declare function codecept(envOptions: EnvCodeceptOptions): ConfigArg;
451
451
  */
452
452
  interface EnvReactOptions extends EnvBaseOptions {
453
453
  /**
454
- * Configuration for the rule '@eslint-react/rules-of-hooks'.
454
+ * Additional hooks that will be treated as state hooks, like 'useState'.
455
455
  *
456
- * Additional hooks that will be treated as effect hooks, like 'useEffect'.
456
+ * Will be used by the rule '@eslint-react/set-state-in-effect'.
457
457
  */
458
- effectHooks?: readonly string[];
458
+ stateHooks?: readonly string[];
459
459
  /**
460
- * Configuration for the rule '@eslint-react/set-state-in-effect'.
460
+ * Additional hooks that will be treated as hooks returning a React ref, like
461
+ * 'useRef'.
461
462
  *
462
- * Additional hooks that will be treated as state hooks, like 'useState'.
463
+ * Will be used by rules that check hooks returning React refs like
464
+ * '@eslint-react/naming-convention-ref-name'.
463
465
  */
464
- stateHooks?: readonly string[];
466
+ refHooks?: readonly string[];
467
+ /**
468
+ * Additional hooks that will be treated as effect hooks, like 'useEffect'.
469
+ *
470
+ * Will be used by the rule '@eslint-react/rules-of-hooks'.
471
+ */
472
+ effectHooks?: readonly string[];
465
473
  }
466
474
  /**
467
475
  * Creates configuration objects with linter rules for ReactJS.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/utils/resolver.ts","../../src/utils/utils.ts","../../src/eslint/shared/env-utils.ts","../../src/eslint/core/vue.ts","../../src/eslint/shared/restricted.ts","../../src/eslint/env/node.ts","../../src/eslint/env/browser.ts","../../src/eslint/shared/unittest.ts","../../src/eslint/env/jest.ts","../../src/eslint/env/vitest.ts","../../src/eslint/env/codecept.ts","../../src/eslint/env/react.ts","../../src/eslint/env/eslint.ts","../../src/eslint/shared/rule-utils.ts","../../src/eslint/rules/project/noInvalidModules.ts","../../src/eslint/rules/project/noInvalidHierarchy.ts","../../src/eslint/env/project.ts","../../src/eslint/env/tsconfig.ts","../../src/eslint/env/decorators.ts","../../src/eslint/index.ts"],"mappings":";;;;;;;;;;cASa;;EAKC,YAAA;;;;;MASR;;;;;;;;;;EAaJ,KAAK;;;;KC7BK,aAAa,KAAK,+BAA+B,cAAc,aAAa;;;KCK5E,SAAS,iBAAe,oBAAoB,OAAO,SAAS,SAAS,WAAW;KAEhF,YAAY,aAAa;;;;UAOpB;;;;;;EAOf,cAAc,OAAO;;;;;;;;;EAUrB;;;;;UAae;;;;;EAMf;;;;EAKA;;;;;UAae;;;;EAKf;;;;EAKA;;;;EAKA;;;;EAKA;;;;;UAMe;;;;;;;;;;EAWf;;;;;;;EAQA,kBAAkB;;;;;;;;;;;;EAalB;;;;;;;;EASA;;;;;;;;;;;;;;EAeA;;;;;;;;;;;;;EAcA;;;;;UAae;;;;;;;EAQf;;;;;;EAOA,OAAO;;;;;;EAOP;;;;;;UASe,uBAAuB;;;;EAKtC,QAAQ;;;;;;;UC9MO;;;;;EAMf;;;;;;;UCRe;EACf;EACA;;;;;UAMe;EACf;EACA;EACA;;;;;UAMe;EACf;EACA;;;;;UAMe;;EAEf,UAAU;;EAEV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S,YAAY,qBAAqB;;;;;;;;;;;;;;;;iBCA1C,WAAW,YAAY,iBAAiB;;;;;;UCc/C;;;;;EAMf;;;;EAKA;;;;;EAMA;;;;EAKA,WAAW;;;;EAKX,WAAW;;;;EAKX,YAAY;;;;EAKZ,MAAM;;;;EAKN,QAAQ;;;;;cAQG;;;;;;;;;;;;;;;;;;;;;;;;;;iBA6BG,aAAa,SAAS,mBAAmB,SAAS,MAAM,cAAc,UAAU,iBAAiB,cAAc"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/utils/resolver.ts","../../src/utils/utils.ts","../../src/eslint/shared/env-utils.ts","../../src/eslint/core/vue.ts","../../src/eslint/shared/restricted.ts","../../src/eslint/env/node.ts","../../src/eslint/env/browser.ts","../../src/eslint/shared/unittest.ts","../../src/eslint/env/jest.ts","../../src/eslint/env/vitest.ts","../../src/eslint/env/codecept.ts","../../src/eslint/env/react.ts","../../src/eslint/env/eslint.ts","../../src/eslint/shared/rule-utils.ts","../../src/eslint/rules/project/noInvalidModules.ts","../../src/eslint/rules/project/noInvalidHierarchy.ts","../../src/eslint/env/project.ts","../../src/eslint/env/tsconfig.ts","../../src/eslint/env/decorators.ts","../../src/eslint/index.ts"],"mappings":";;;;;;;;;;cASa;;EAKC,YAAA;;;;;MASR;;;;;;;;;;EAaJ,KAAK;;;;KC7BK,aAAa,KAAK,+BAA+B,cAAc,aAAa;;;KCK5E,SAAS,iBAAe,oBAAoB,OAAO,SAAS,SAAS,WAAW;KAEhF,YAAY,aAAa;;;;UAOpB;;;;;;EAOf,cAAc,OAAO;;;;;;;;;EAUrB;;;;;UAae;;;;;EAMf;;;;EAKA;;;;;UAae;;;;EAKf;;;;EAKA;;;;EAKA;;;;EAKA;;;;;UAMe;;;;;;;;;;EAWf;;;;;;;EAQA,kBAAkB;;;;;;;;;;;;EAalB;;;;;;;;EASA;;;;;;;;;;;;;;EAeA;;;;;;;;;;;;;EAcA;;;;;UAae;;;;;;;EAQf;;;;;;EAOA,OA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AKU,gCAAgC,eAAe;;;;;;UC1B1C,0BAA0B;;;;EAKzC,QAAQ;;;;EAKR,WAAW;;;;EAKX,YAAY;;;;;;;;;;;iBAcU,QAAQ,YAAY,oBAAoB;;;;;;UCjC/C,2BAA2B;;;;EAK1C;;;;;;;;;;;iBAcsB,SAAS,YAAY,qBAAqB;;;;;;;;;;;;;;;;iBCA1C,WAAW,YAAY,iBAAiB;;;;;;UCc/C;;;;;EAMf;;;;EAKA;;;;;EAMA;;;;EAKA,WAAW;;;;EAKX,WAAW;;;;EAKX,YAAY;;;;EAKZ,MAAM;;;;EAKN,QAAQ;;;;;cAQG;;;;;;;;;;;;;;;;;;;;;;;;;;iBA6BG,aAAa,SAAS,mBAAmB,SAAS,MAAM,cAAc,UAAU,iBAAiB,cAAc"}
@@ -1827,8 +1827,9 @@ function preferDestructuringAssignment() {
1827
1827
  function react(envOptions) {
1828
1828
  const reactConfig = reactPlugin.configs["strict-type-checked"];
1829
1829
  const settings = { ...reactConfig.settings };
1830
- if (envOptions.effectHooks?.length) mergeSettings(settings, "react-x", { additionalEffectHooks: `/^(${envOptions.effectHooks.join("|")})$/` });
1831
1830
  if (envOptions.stateHooks?.length) mergeSettings(settings, "react-x", { additionalStateHooks: `/^(${envOptions.stateHooks.join("|")})$/` });
1831
+ if (envOptions.refHooks?.length) mergeSettings(settings, "react-x", { additionalRefHooks: `/^(${envOptions.refHooks.join("|")})$/` });
1832
+ if (envOptions.effectHooks?.length) mergeSettings(settings, "react-x", { additionalEffectHooks: `/^(${envOptions.effectHooks.join("|")})$/` });
1832
1833
  return [
1833
1834
  createConfig("env.react.recommended", envOptions, {
1834
1835
  languageOptions: {
@@ -1843,11 +1844,13 @@ function react(envOptions) {
1843
1844
  "@eslint-react/jsx-no-useless-fragment": ["error", { allowEmptyFragment: true }],
1844
1845
  "@eslint-react/naming-convention-context-name": "error",
1845
1846
  "@eslint-react/no-missing-component-display-name": "error",
1846
- "@eslint-react/no-missing-context-display-name": "error"
1847
+ "@eslint-react/no-missing-context-display-name": "error",
1848
+ "@eslint-react/refs": "error"
1847
1849
  }),
1848
1850
  createConfig("env.react.recommended", envOptions, { extends: [reactKit().use(jsxShorthandBoolean).use(preferDestructuringAssignment).getConfig()] }),
1849
1851
  createConfig("env.react.react-hooks", envOptions, convertRuleWarningsToErrors(reactHooksPlugin.configs.flat.recommended), {
1850
1852
  "react-hooks/exhaustive-deps": "off",
1853
+ "react-hooks/refs": "off",
1851
1854
  "react-hooks/rules-of-hooks": "off",
1852
1855
  "react-hooks/set-state-in-effect": "off",
1853
1856
  "react-hooks/set-state-in-render": "off"
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["pluginConfigs","jsdoc","jsdocPlugin","NodeType","#aliasMap","#rootDir","#configPath","#moduleName","#requireModule","NodeType","NodeType","NodeType","noInvalidModules","noInvalidHierarchy","defineEslintConfig","jsdoc"],"sources":["../../src/utils/utils.ts","../../src/eslint/shared/env-utils.ts","../../src/eslint/shared/restricted.ts","../../src/eslint/core/base.ts","../../src/eslint/core/js.ts","../../src/eslint/core/ts.ts","../../src/eslint/core/vue.ts","../../src/eslint/core/json.ts","../../src/eslint/core/yaml.ts","../../src/eslint/core/markdown.ts","../../src/eslint/core/license.ts","../../src/eslint/core/directives.ts","../../src/eslint/core/packages.ts","../../src/eslint/core/regexp.ts","../../src/eslint/core/promises.ts","../../src/eslint/core/jsdoc.ts","../../src/eslint/core/stylistic.ts","../../src/eslint/env/node.ts","../../src/eslint/env/browser.ts","../../src/eslint/shared/unittest.ts","../../src/eslint/env/jest.ts","../../src/eslint/env/vitest.ts","../../src/eslint/env/codecept.ts","../../src/eslint/shared/rule-utils.ts","../../src/eslint/rules/react/jsxShorthandBoolean.ts","../../src/eslint/rules/react/preferDestructuringAssignment.ts","../../src/eslint/env/react.ts","../../src/eslint/env/eslint.ts","../../src/eslint/rules/project/noInvalidModules.ts","../../src/eslint/rules/project/noInvalidHierarchy.ts","../../src/eslint/env/project.ts","../../src/eslint/env/tsconfig.ts","../../src/eslint/env/decorators.ts","../../src/eslint/index.ts"],"sourcesContent":["\n// types ======================================================================\n\nexport type DeepRequired<T> = {\n [key in keyof T]-?: DeepRequired<T[key]>\n}\n\nexport type DeepOptArray<T> = T | false | null | undefined | ReadonlyArray<DeepOptArray<T>>\n\n// functions ==================================================================\n\n/**\n * Creates an iterator that visits all truthy elements of all deeply nested\n * arrays.\n *\n * @template T\n * The element type of the array.\n *\n * @param arrays\n * The deeply nested arrays to be visited.\n *\n * @yields\n * The truthy array elements.\n */\nexport function *yieldDeepArrays<T>(...arrays: Array<DeepOptArray<T>>): IterableIterator<T> {\n for (const element of arrays) {\n if (Array.isArray(element)) {\n yield* yieldDeepArrays(...element)\n } else if (element) {\n yield element as T\n }\n }\n}\n\n/**\n * Returns a flat array with all truthy elements of all deeply nested arrays.\n *\n * @template T\n * The element type of the array.\n *\n * @param arrays\n * The deeply nested arrays to be flattened.\n *\n * @returns\n * The flattened array elements.\n */\nexport function flattenDeepArrays<T>(...arrays: Array<DeepOptArray<T>>): T[] {\n return [...yieldDeepArrays(...arrays)]\n}\n","\nimport type { Linter } from 'eslint'\nimport type { RuleConfig, RulesConfig, ConfigObject } from '@eslint/core'\nimport type { ConfigWithExtends } from '@eslint/config-helpers'\nimport type { TSESLint } from '@typescript-eslint/utils'\n\nimport type { DeepRequired, DeepOptArray } from '@/utils/utils.ts'\nimport { flattenDeepArrays } from '@/utils/utils.ts'\n\n// types ======================================================================\n\n// TODO: investigate: `Config` from '@eslint/config-helpers' is incompatible with `Linter.Config` and `TSESLint.FlatConfig.Config`\nexport type Config = ConfigObject | ConfigWithExtends | Linter.Config | TSESLint.FlatConfig.Config\n\nexport type ConfigArg = DeepOptArray<Config>\n\n// ----------------------------------------------------------------------------\n\n/**\n * Configuration options for language and project setup.\n */\nexport interface LanguageOptions {\n\n /**\n * The ECMAScript version to be used in the project (version or year).\n *\n * @default 'latest'\n */\n ecmaVersion?: Linter.EcmaVersion\n\n /**\n * Specifies how to treat `.js`, `.jsx`, `.ts`, and `.tsx` files.\n *\n * - 'module': The files will be considered being ES modules.\n * - 'commonjs': The files will be considered being CommonJS modules.\n *\n * @default 'module'\n */\n sourceType?: 'module' | 'commonjs'\n}\n\n/**\n * Required configuration options for language and project setup.\n */\nexport type LanguageConfig = DeepRequired<LanguageOptions>\n\n// ----------------------------------------------------------------------------\n\n/**\n * Configuration options for external package dependencies.\n */\nexport interface PackagesOptions {\n\n /**\n * A list of packages to be allowed in the project even if they have been\n * banned by the plugin `eslint-plugin-depend`.\n */\n allowed?: readonly string[]\n\n /**\n * A list of additional packages to be banned in the project.\n */\n banned?: readonly string[]\n}\n\n/**\n * Required configuration options for external package dependencies.\n */\nexport type PackagesConfig = DeepRequired<PackagesOptions>\n\n// ----------------------------------------------------------------------------\n\n/**\n * Configuration options for code indentation per file type.\n */\nexport interface IndentOverridesOptions {\n\n /**\n * Indentation size for JavaScript and TypeScript files, including JSX.\n */\n js?: number\n\n /**\n * Indentation size for JSON files.\n */\n json?: number\n\n /**\n * Indentation size for YAML files.\n */\n yaml?: number\n\n /**\n * Indentation size for Vue.js files (script and template blocks).\n */\n vue?: number\n}\n\n/**\n * Configuration options for code style.\n */\nexport interface StylisticOptions {\n\n /**\n * Default indentation (number of space characters) for all file types.\n *\n * Affects rules `@stylistic/indent`, `@stylistic/indent-binary-ops`,\n * `@stylistic/jsx-indent-props`, `vue/html-indent`, `jsonc/indent`, and\n * `yml/indent`.\n *\n * @default 2\n */\n indent?: number\n\n /**\n * Indentation (number of space characters) overrides for specific file\n * types.\n *\n * @default 2\n */\n indentOverrides?: IndentOverridesOptions\n\n /**\n * Specifies how to treat semicolons.\n *\n * - 'always': Require semicolons following all statements.\n * - 'never': Require to omit semicolons according to ASI rules.\n * - 'off': Semicolons will not be checked.\n *\n * Affects rules `@stylistic/semi` and `@stylistic/member-delimiter-style`.\n *\n * @default 'never'\n */\n semi?: 'always' | 'never' | 'off'\n\n /**\n * The type of the string delimiter character.\n *\n * Affects rule `@stylistic/string-quotes`.\n *\n * @default 'single'\n */\n quotes?: 'single' | 'double' | 'off'\n\n /**\n * Specifies how to treat dangling commas in multiline lists.\n *\n * - 'always': Dangling commas will be required in all multi-line array\n * literals, object literals, function parameters, template parameters,\n * imports, and exports.\n * - 'never': Dangling commas will be forbidden.\n * - 'off': Dangling commas will not be checked.\n *\n * Affects rules `@stylistic/comma-dangle` and `vue/comma-dangle`.\n *\n * @default 'always'\n */\n dangle?: 'always' | 'never' | 'off'\n\n /**\n * Specifies whether to expect whitespace between function names and\n * parentheses. Does not affect anonymous functions and `catch` clauses.\n *\n * Affects rule `@stylistic/space-before-function-paren`.\n *\n * - 'always': Spacing between function name and parenthesis required.\n * - 'never': Spacing between function name and parenthesis forbidden.\n * - 'off': Spacing between function name and parenthesis will be ignored.\n *\n * @default 'off'\n */\n funcSpacing?: 'always' | 'never' | 'off'\n}\n\n/**\n * Required configuration options for code style.\n */\nexport type StylisticConfig = DeepRequired<StylisticOptions>\n\n// ----------------------------------------------------------------------------\n\n/**\n * Shared options for an environment preset with included and excluded files.\n */\nexport interface EnvFilesOptions {\n\n /**\n * Path to a sub directory to apply the environment preset to. The options\n * 'files' and 'ignores' will be interpreted relatively to this path.\n *\n * @default '.'\n */\n basePath?: string\n\n /**\n * Glob patterns for source files to be included into the environment. A file\n * will be included if it matches one of the patterns. Inner arrays can be\n * used to express AND conditions for files.\n */\n files: ReadonlyArray<string | string[]>\n\n /**\n * Glob patterns for source files matching `files` to be ignored.\n *\n * @default []\n */\n ignores?: readonly string[]\n}\n\n// ----------------------------------------------------------------------------\n\n/**\n * Shared options for an environment preset: include and exclude files, and add\n * more linter rules.\n */\nexport interface EnvBaseOptions extends EnvFilesOptions {\n\n /**\n * Additional linter rules to be added to the configuration.\n */\n rules?: RulesConfig\n}\n\n// constants ==================================================================\n\n/**\n * File extensions for JavaScript source files.\n */\nexport const JS_EXTENSIONS = ['js', 'jsx', 'mjs', 'cjs']\n\n/**\n * File extensions for TypeScript source files.\n */\nexport const TS_EXTENSIONS = ['ts', 'tsx', 'mts', 'cts']\n\n/**\n * File extensions for all source files (JavaScript and TypeScript).\n */\nexport const SRC_EXTENSIONS = [...JS_EXTENSIONS, ...TS_EXTENSIONS]\n\n/**\n * Glob array for JavaScript source files (including 'jsx').\n */\nexport const JS_GLOB = extGlob(JS_EXTENSIONS)\n\n/**\n * Glob array for TypeScript source files (including 'tsx').\n */\nexport const TS_GLOB = extGlob(TS_EXTENSIONS)\n\n/**\n * Glob array for TypeScript type declaration files.\n */\nexport const DTS_GLOB = extGlob(TS_EXTENSIONS.map(ext => 'd.' + ext))\n\n/**\n * Glob array for all source files (JavaScript and TypeScript).\n */\nexport const SRC_GLOB = extGlob(SRC_EXTENSIONS)\n\n/**\n * Glob array for all VueJS SFC files.\n */\nexport const VUE_GLOB = extGlob(['vue'])\n\n/**\n * Shared options for the core rule `no-unused-vars`, and the plugin rule\n * `@typescript-eslint/no-unused-vars`.\n */\nexport const NO_UNUSED_VARS_OPTIONS = {\n varsIgnorePattern: '^_.',\n argsIgnorePattern: '^_.',\n destructuredArrayIgnorePattern: '^_.',\n caughtErrors: 'all',\n ignoreRestSiblings: true,\n}\n\n/**\n * Shared options for the core rule `no-implicit-coercion`, and all related\n * plugin rules (e.g. from the Vue plugin).\n */\nexport const NO_IMPLICIT_COERCION_OPTIONS = {\n disallowTemplateShorthand: true,\n allow: ['!!'] as ['!!'], // workaround for overly strict typings of 'eslint-plugin-vue'\n}\n\n// functions ==================================================================\n\n/**\n * Creates a glob pattern deeply matching all files with the specified file\n * extensions.\n *\n * @param extensions\n * The file extensions to be converted to a glob pattern.\n *\n * @returns\n * The glob pattern for the specified file extensions.\n */\nexport function extGlob(extensions: string[]): string[] {\n return extensions.map(ext => '**/*.' + ext)\n}\n\n/**\n * Creates a configuration entry with 'files' and 'ignores' settings from an\n * environment's 'envOptions' object.\n *\n * @param name\n * The name of the configuration entry.\n *\n * @param envOptions\n * The environment options containing 'files' and 'ignores' settings.\n *\n * @param config\n * Properties for the configuration entry to be built. Additional 'files' and\n * 'ignores' properties will be merged with the settings from 'envOptions'.\n *\n * @param rules\n * Hard-coded rule settings to be added to the configuration.\n *\n * @returns\n * The resulting configuration entry.\n */\nexport function createConfig(name: string, envOptions: EnvFilesOptions, config: Config, rules?: RulesConfig): Config {\n const basePath = envOptions.basePath ?? config.basePath\n return {\n ...config,\n name,\n ...(basePath ? { basePath } : undefined),\n files: [envOptions.files, config.files].filter(e => !!e).flat(1),\n ignores: [envOptions.ignores, config.ignores].filter(e => !!e).flat(1),\n rules: { ...config.rules, ...rules },\n }\n}\n\n/**\n * Creates a configuration entry with 'files', 'ignores', and 'rules' settings\n * from an environment's 'envOptions' object.\n *\n * @param name\n * The name of the configuration entry.\n *\n * @param envOptions\n * The environment options containing 'files', 'ignores', and 'rules'\n * settings.\n *\n * @param rules\n * Hard-coded rule settings to be configured by the environment itself. These\n * rule settings will precede the rules contained in 'envOptions', in order to\n * allow to override them.\n *\n * @returns\n * The resulting configuration entry, if the environment options contain\n * custom rule settings, otherwise `undefined`.\n */\nexport function customRules(name: string, envOptions: EnvBaseOptions, rules?: RulesConfig): Config | undefined {\n return (rules ?? envOptions.rules) && createConfig(name, envOptions, {\n rules: { ...rules, ...envOptions.rules },\n })\n}\n\n/**\n * Finds the first configuration object with a 'files' property, and copies\n * this property into all other configurations objects with language options or\n * rules but lacking the 'files' property.\n *\n * @param configs\n * The configuration objects to be fixed.\n *\n * @returns\n * The fixed configuration options.\n */\nexport function fixMissingFilesOption(...configs: ConfigArg[]): Config[] {\n const flatConfigs = flattenDeepArrays(configs)\n const files = flatConfigs.find(config => !!config.files)?.files\n return files ? flatConfigs.map(config => (!config.files && (config.languageOptions || config.rules)) ? { ...config, files } : config) : flatConfigs\n}\n\n/**\n * Converts severity 'warning' of all rules in the passed configuration entry\n * to severity 'error'.\n *\n * @template T\n * The exact type of the passed configuration.\n *\n * @param config\n * The configuration entry to be converted.\n *\n * @returns\n * The converted configuration entry.\n */\nexport function convertRuleWarningsToErrors<T extends { rules?: Partial<RulesConfig> }>(config: T): T {\n return config.rules ? {\n ...config,\n rules: Object.fromEntries(Object.entries(config.rules).map(([key, value]) => {\n if (value === 'warn') {\n value = 'error'\n } else if (Array.isArray(value) && (value[0] === 'warn')) {\n value = ['error', ...value.slice(1)]\n }\n return [key, value]\n })),\n } : config\n}\n\n/**\n * Merges settings for a specific plugin in-place into a complete settings\n * object.\n *\n * @param settings\n * The settings object to be extended.\n *\n * @param plugin\n * The name of the plugin whose settings will be extended (top-level property\n * name in `settings`). Missing entries will be created on demand.\n *\n * @param props\n * The settings properties to me merged into the plugin settings.\n *\n * @returns\n * The extended settings object.\n */\nexport function mergeSettings(settings: Record<string, unknown>, plugin: string, props: Record<string, unknown>): Record<string, unknown> {\n const pluginSettings = settings[plugin] ??= {}\n Object.assign(pluginSettings, props)\n return settings\n}\n\n/**\n * Translates the stylistic option `dangle` to the configuration options for\n * 'comma-dangle' rules.\n *\n * @param stylisticConfig\n * Resolved stylistic configuration options.\n *\n * @returns\n * The configuration options for 'comma-dangle' rules.\n */\nexport function getCommaDangleConfig(stylisticConfig: StylisticConfig): RuleConfig<['never' | 'always' | 'always-multiline']> {\n const { dangle } = stylisticConfig\n return (dangle === 'always') ? ['error', 'always-multiline'] : (dangle === 'never') ? ['error', 'never'] : 'off'\n}\n","\nimport type { RulesConfig } from '@eslint/core'\n\nimport { flattenDeepArrays } from '@/utils/utils.ts'\nimport type { ConfigArg, EnvFilesOptions, EnvBaseOptions } from '@/eslint/shared/env-utils.ts'\nimport { createConfig } from '@/eslint/shared/env-utils.ts'\n\n// types ======================================================================\n\n/**\n * Configuration for a single banned global or import.\n */\nexport interface EnvRestrictedName {\n name: string\n message: string\n}\n\n/**\n * Configuration for a single banned object property.\n */\nexport interface EnvRestrictedProperty {\n object: string\n property: string\n message: string\n}\n\n/**\n * Configuration for a single banned syntax construct.\n */\nexport interface EnvRestrictedSyntax {\n selector: string\n message: string\n}\n\n/**\n * Collection of banned globals, imports, properties, and syntax constructs.\n */\nexport interface EnvRestrictedItems {\n /** The global symbols to be banned. */\n globals?: EnvRestrictedName[]\n /** The module imports to be banned. */\n imports?: EnvRestrictedName[]\n /** The global object properties to be banned. */\n properties?: EnvRestrictedProperty[]\n /** The syntax constructs to be banned. */\n syntax?: EnvRestrictedSyntax[]\n}\n\n/**\n * Collection of banned globals, imports, properties, and syntax constructs,\n * for a specific subset of the files included in an environment.\n */\nexport interface EnvRestrictedOverride extends EnvFilesOptions, EnvRestrictedItems { }\n\n/**\n * Type shape of a dedicated environment option 'restricted' with settings for\n * banned globals, imports, properties, and syntax constructs.\n */\nexport interface EnvRestrictedOption extends EnvRestrictedItems {\n\n /**\n * Overrides for specific subsets of files in the environment. All restricted\n * items of overrides will be merged with the common restricted items defined\n * for the entire environment.\n */\n overrides?: EnvRestrictedOverride[]\n}\n\n/**\n * Shared options for an environment preset: include and exclude files, add\n * more linter rules, and settings for restricted items.\n */\nexport interface EnvRestrictedOptions extends EnvBaseOptions {\n\n /**\n * All globals, imports, properties, and syntax constructs to be banned for\n * the files included by the environment.\n */\n restricted?: EnvRestrictedOption\n}\n\n// ----------------------------------------------------------------------------\n\n/**\n * Helper interface for type conversion.\n */\ninterface EnvRestrictedEntryTypeMap {\n globals: EnvRestrictedName\n imports: EnvRestrictedName\n properties: EnvRestrictedProperty\n syntax: EnvRestrictedSyntax\n}\n\ntype EnvRestrictedEntryKey = keyof EnvRestrictedEntryTypeMap\ntype EnvRestrictedEntryType = EnvRestrictedEntryTypeMap[EnvRestrictedEntryKey]\n\n// functions ==================================================================\n\n/**\n * Creates a rules configuration record for all restricted items.\n *\n * @param generator\n * The generator callback function that returns the restricted items to be\n * inserted into the linter rules.\n *\n * @returns\n * The rules configuration record containing entries for all existing\n * restricted items.\n */\nfunction createRulesConfig(generator: (key: EnvRestrictedEntryKey) => readonly EnvRestrictedEntryType[]): RulesConfig {\n const rules: RulesConfig = {}\n for (const key of ['globals', 'imports', 'properties', 'syntax'] as const) {\n const items = generator(key)\n if (items.length) rules[`no-restricted-${key}`] = ['error', ...items]\n }\n // same restrictions for CommonJS `require` as for `import` statements\n if ('no-restricted-imports' in rules) {\n rules['no-restricted-modules'] = rules['no-restricted-imports']\n }\n return rules\n}\n\n/**\n * Merges built-in items and custom items for restricted rules.\n *\n * @param restrictedItems\n * The custom items for restricted rules to be merged.\n *\n * @returns\n * The rules dictionary with all needed restricted rules.\n */\nfunction mergeRestrictedItems(...restrictedItems: Array<EnvRestrictedItems | undefined>): Required<EnvRestrictedItems> {\n\n const RESTRICTED_GLOBALS: EnvRestrictedName[] = [\n { name: 'isFinite', message: 'Use `Number.isFinite` instead.' },\n { name: 'isNaN', message: 'Use `Number.isNaN` instead.' },\n ]\n\n const RESTRICTED_SYNTAX: EnvRestrictedSyntax[] = [\n { selector: ':matches(PropertyDefinition, MethodDefinition[kind!=\"constructor\"])[accessibility=\"private\"]', message: 'Use `#private` syntax instead.' },\n ]\n\n // restricted items for all files in the environment\n return {\n globals: flattenDeepArrays(RESTRICTED_GLOBALS, restrictedItems.map(item => item?.globals)),\n imports: flattenDeepArrays(restrictedItems.map(item => item?.imports)),\n properties: flattenDeepArrays(restrictedItems.map(item => item?.properties)),\n syntax: flattenDeepArrays(RESTRICTED_SYNTAX, restrictedItems.map(item => item?.syntax)),\n }\n}\n\n// ----------------------------------------------------------------------------\n\n/**\n * Creates restricted rules with built-in restricted items only.\n *\n * @returns\n * The rules dictionary with all needed restricted rules.\n */\nexport function builtinRestrictedRules(): RulesConfig {\n\n // built-in restricted items\n const items = mergeRestrictedItems()\n\n // generate the rules dictionary\n return createRulesConfig(key => items[key])\n}\n\n/**\n * Generates various 'no-restricted-?' rules from the passed configuration.\n *\n * @param baseName\n * Base name for the configuration objects.\n *\n * @param envOptions\n * The environment options containing 'files', 'ignores', and 'restricted'\n * settings.\n *\n * @param fixed\n * The fixed restricted items provided by the environment preset.\n *\n * @returns\n * The configuration entries needed to forbid the restricted items.\n */\nexport function restrictedRulesConfig(baseName: string, envOptions: EnvRestrictedOptions, fixed?: EnvRestrictedItems): ConfigArg {\n\n const { restricted } = envOptions\n\n // restricted items for all files in the environment\n const items = mergeRestrictedItems(fixed, restricted)\n\n // generate the configuration objects\n return [\n\n // base rules for all files in the environment\n createConfig(baseName, envOptions, {\n rules: createRulesConfig(key => items[key]),\n }),\n\n // generate the override entries (join with base items)\n restricted?.overrides?.map((override, index) => createConfig(`${baseName}.override-${index}`, override, {\n rules: createRulesConfig(key => flattenDeepArrays<EnvRestrictedEntryType>(items[key], override[key])),\n })),\n ]\n}\n","\nimport type { ConfigObject } from '@eslint/core'\nimport eslintJs from '@eslint/js'\n\nimport type { ConfigArg, LanguageConfig } from '@/eslint/shared/env-utils.ts'\nimport { SRC_GLOB, VUE_GLOB, NO_IMPLICIT_COERCION_OPTIONS, extGlob } from '@/eslint/shared/env-utils.ts'\nimport { builtinRestrictedRules } from '@/eslint/shared/restricted.ts'\n\n// functions ==================================================================\n\n/**\n * Defines standard module settings and additional rules targeting JavaScript\n * _and_ TypeScript source files.\n *\n * Wraps the following packages:\n * - `@eslint/js`\n *\n * @param languageConfig\n * Resolved configuration options.\n *\n * @returns\n * The configuration entries to be added to the resulting configuration array.\n */\nexport default function base(languageConfig: LanguageConfig): ConfigArg {\n\n // returns language options for specific file extensions\n const languageOptions = (sourceType: LanguageConfig['sourceType'], ...extensions: string[]): ConfigObject => {\n const { ecmaVersion } = languageConfig\n return {\n name: `core.base.language-options.${sourceType}.${extensions.join(',')}`,\n files: extGlob(extensions),\n languageOptions: { ecmaVersion, sourceType },\n }\n }\n\n return [\n\n // global linter configuration\n {\n name: 'core.base.linter-options',\n linterOptions: {\n // report unused inline linter directives in source code\n reportUnusedDisableDirectives: 'error',\n reportUnusedInlineConfigs: 'error',\n },\n },\n\n // ECMA version and module type for ES modules\n languageOptions('module', 'mjs', 'mts'),\n\n // ECMA version and module type for CommonJS modules\n languageOptions('commonjs', 'cjs', 'cts'),\n\n // ECMA version and module type for *.js and *.ts files\n languageOptions(languageConfig.sourceType, 'js', 'jsx', 'ts', 'tsx'),\n\n // configure linter rules\n {\n name: 'core.base.rules',\n files: [...SRC_GLOB, ...VUE_GLOB],\n rules: {\n // enable all rules recommended by ESLint itself\n ...eslintJs.configs.recommended.rules,\n // possible problems\n 'no-cond-assign': ['error', 'except-parens'],\n 'no-constant-binary-expression': 'error',\n 'no-constructor-return': 'error',\n 'no-control-regex': 'off',\n 'no-duplicate-imports': ['error', { allowSeparateTypeImports: true }],\n 'no-new-native-nonconstructor': 'error',\n 'no-new-symbol': 'off', // disabled in favour of 'no-new-native-nonconstructor'\n 'no-promise-executor-return': ['error', { allowVoid: true }],\n 'no-self-compare': 'error',\n 'no-template-curly-in-string': 'error',\n 'no-unassigned-vars': 'error',\n 'no-unreachable-loop': 'error',\n 'no-unsafe-optional-chaining': ['error', { disallowArithmeticOperators: true }],\n 'no-unused-private-class-members': 'off', // separate rules for JS and TS\n 'require-atomic-updates': 'error',\n // suggestions\n 'block-scoped-var': 'error',\n curly: ['error', 'multi-line'],\n eqeqeq: 'error',\n 'grouped-accessor-pairs': 'error',\n 'new-cap': 'error',\n 'no-alert': 'error',\n 'no-caller': 'error',\n 'no-console': 'error',\n 'no-else-return': 'error',\n 'no-empty': 'off',\n 'no-empty-static-block': 'error',\n 'no-eval': 'error',\n 'no-extend-native': 'error',\n 'no-extra-bind': 'error',\n 'no-extra-label': 'error',\n 'no-implicit-coercion': ['error', NO_IMPLICIT_COERCION_OPTIONS],\n 'no-implied-eval': 'error',\n 'no-iterator': 'error',\n 'no-label-var': 'error',\n 'no-labels': 'error',\n 'no-lone-blocks': 'error',\n 'no-lonely-if': 'error',\n 'no-multi-str': 'error',\n 'no-new': 'error',\n 'no-new-func': 'error',\n 'no-new-wrappers': 'error',\n 'no-object-constructor': 'error',\n 'no-octal-escape': 'error',\n 'no-proto': 'error',\n 'no-return-assign': ['error', 'except-parens'],\n 'no-script-url': 'error',\n 'no-sequences': ['error', { allowInParentheses: false }],\n 'no-unneeded-ternary': ['error', { defaultAssignment: false }],\n 'no-unused-expressions': 'error',\n 'no-useless-assignment': 'error',\n 'no-useless-call': 'error',\n 'no-useless-computed-key': 'error',\n 'no-useless-concat': 'error',\n 'no-useless-rename': 'error',\n 'no-useless-return': 'error',\n 'no-var': 'error',\n 'object-shorthand': 'error',\n 'operator-assignment': 'error',\n 'prefer-arrow-callback': 'error',\n 'prefer-const': ['error', { destructuring: 'all', ignoreReadBeforeAssign: true }],\n 'prefer-numeric-literals': 'error',\n 'prefer-regex-literals': 'error',\n 'prefer-rest-params': 'error',\n 'prefer-spread': 'error',\n radix: 'error',\n 'symbol-description': 'error',\n // built-in restricted items\n ...builtinRestrictedRules(),\n },\n },\n ]\n}\n","\nimport { type ConfigArg, JS_GLOB, NO_UNUSED_VARS_OPTIONS } from '@/eslint/shared/env-utils.ts'\n\n// functions ==================================================================\n\n/**\n * Defines additional standard rules targeting JavaScript but _not_ TypeScript\n * source files.\n *\n * @returns\n * The configuration entries to be added to the resulting configuration array.\n */\nexport default function js(): ConfigArg {\n\n return {\n name: 'core.js.recommended',\n files: JS_GLOB,\n rules: {\n // possible problems\n 'no-loss-of-precision': 'off',\n 'no-unused-vars': ['error', NO_UNUSED_VARS_OPTIONS],\n // suggestions\n 'default-param-last': 'error',\n 'dot-notation': 'error',\n 'no-array-constructor': 'error',\n 'no-invalid-this': 'error',\n 'no-loop-func': 'error',\n 'no-redeclare': 'error',\n 'no-shadow': ['error', { ignoreOnInitialization: true }],\n 'no-throw-literal': 'error',\n 'no-unused-private-class-members': 'error',\n 'no-useless-constructor': 'error',\n 'prefer-promise-reject-errors': 'error',\n 'require-await': 'error',\n },\n }\n}\n","\nimport type { RulesConfig } from '@eslint/core'\nimport { configs as pluginConfigs } from 'typescript-eslint'\n\nimport type { ConfigArg } from '@/eslint/shared/env-utils.ts'\nimport { SRC_GLOB, TS_GLOB, DTS_GLOB, VUE_GLOB, NO_UNUSED_VARS_OPTIONS } from '@/eslint/shared/env-utils.ts'\n\n// types ======================================================================\n\nexport type TSESLintConfigKey = keyof typeof pluginConfigs\n\n// constants ==================================================================\n\n/**\n * Names of all `typescript-eslint` presets to be included\n */\nexport const TSESLINT_PRESETS = ['strictTypeChecked', 'stylisticTypeChecked'] as const satisfies TSESLintConfigKey[]\n\n/**\n * Custom configuration for `typescript-eslint` rules.\n */\nexport const TSESLINT_RULES = {\n '@typescript-eslint/array-type': 'off',\n '@typescript-eslint/consistent-indexed-object-style': 'off',\n '@typescript-eslint/consistent-type-exports': 'error',\n '@typescript-eslint/consistent-type-imports': ['error', { disallowTypeAnnotations: false }],\n '@typescript-eslint/default-param-last': 'error',\n '@typescript-eslint/explicit-function-return-type': ['error', {\n allowExpressions: true,\n allowTypedFunctionExpressions: true,\n allowHigherOrderFunctions: true,\n allowConciseArrowFunctionExpressionsStartingWithVoid: true,\n }],\n '@typescript-eslint/explicit-member-accessibility': ['error', { accessibility: 'no-public', overrides: { constructors: 'off' } }],\n '@typescript-eslint/no-confusing-void-expression': 'off',\n '@typescript-eslint/no-dynamic-delete': 'off',\n '@typescript-eslint/no-empty-function': ['error', {\n allow: ['private-constructors', 'protected-constructors', 'decoratedFunctions', 'overrideMethods'],\n }],\n '@typescript-eslint/no-empty-object-type': ['error', { allowInterfaces: 'always' }],\n '@typescript-eslint/no-explicit-any': 'off',\n '@typescript-eslint/no-import-type-side-effects': 'error',\n '@typescript-eslint/no-invalid-this': 'error',\n '@typescript-eslint/no-invalid-void-type': 'off',\n '@typescript-eslint/no-loop-func': 'error',\n '@typescript-eslint/no-misused-spread': 'error',\n '@typescript-eslint/no-namespace': ['error', { allowDeclarations: true }],\n '@typescript-eslint/no-non-null-assertion': 'off',\n '@typescript-eslint/no-redeclare': 'error',\n '@typescript-eslint/no-shadow': ['error', { ignoreOnInitialization: true }],\n '@typescript-eslint/no-unnecessary-qualifier': 'error',\n // disabled temporarily: https://github.com/typescript-eslint/typescript-eslint/issues/12158\n '@typescript-eslint/no-unnecessary-type-arguments': 'off',\n '@typescript-eslint/no-unnecessary-type-conversion': 'error',\n '@typescript-eslint/no-unnecessary-type-parameters': 'off',\n '@typescript-eslint/no-unsafe-declaration-merging': 'off',\n '@typescript-eslint/no-unused-private-class-members': 'error',\n '@typescript-eslint/no-unused-vars': ['error', NO_UNUSED_VARS_OPTIONS],\n '@typescript-eslint/parameter-properties': 'error',\n '@typescript-eslint/prefer-nullish-coalescing': ['error', { ignorePrimitives: true }],\n '@typescript-eslint/prefer-readonly': 'error',\n '@typescript-eslint/prefer-reduce-type-parameter': 'off',\n '@typescript-eslint/restrict-template-expressions': 'off',\n '@typescript-eslint/return-await': ['error', 'always'],\n '@typescript-eslint/strict-void-return': ['error', { allowReturnAny: true }],\n '@typescript-eslint/switch-exhaustiveness-check': ['error', { considerDefaultExhaustiveForUnions: true }],\n '@typescript-eslint/unified-signatures': ['error', { ignoreDifferentlyNamedParameters: true }],\n} as const satisfies RulesConfig\n\n// functions ==================================================================\n\n/**\n * Defines standard rules for TypeScript source files.\n *\n * Wraps the following packages:\n * - `typescript-eslint`\n *\n * @param rootDir\n * The project root directory.\n *\n * @returns\n * The configuration entries to be added to the resulting configuration array.\n */\nexport default function ts(rootDir: string): ConfigArg {\n\n // plugin configuration, additional rules\n return [\n\n {\n name: 'core.ts.options',\n files: [...SRC_GLOB, ...VUE_GLOB],\n languageOptions: {\n parserOptions: {\n projectService: true,\n tsconfigRootDir: rootDir,\n // suppress warning for new TypeScript versions\n warnOnUnsupportedTypeScriptVersion: false,\n },\n },\n },\n\n {\n name: 'core.ts.recommended',\n files: TS_GLOB,\n\n // recommended rules\n extends: TSESLINT_PRESETS.map(key => pluginConfigs[key]),\n\n // reconfigure plugin rules\n rules: TSESLINT_RULES,\n },\n\n // fixes for module definition files\n {\n name: 'core.ts.dts',\n files: DTS_GLOB,\n rules: {\n 'no-duplicate-imports': 'off', // triggers for multiple 'declare' blocks in a file\n '@typescript-eslint/consistent-type-exports': 'off',\n '@typescript-eslint/consistent-type-imports': ['error', { prefer: 'no-type-imports', disallowTypeAnnotations: false }],\n '@typescript-eslint/no-extraneous-class': 'off',\n '@typescript-eslint/no-unused-private-class-members': 'off', // allow to declare private class members\n '@typescript-eslint/prefer-readonly': 'off', // allow to declare class members without 'readonly'\n },\n },\n ]\n}\n","\nimport vuePlugin from 'eslint-plugin-vue'\nimport { configureVueProject, defineConfigWithVueTs, vueTsConfigs } from '@vue/eslint-config-typescript'\n\nimport type { ConfigArg, StylisticConfig } from '@/eslint/shared/env-utils.ts'\nimport { VUE_GLOB, NO_IMPLICIT_COERCION_OPTIONS, getCommaDangleConfig } from '@/eslint/shared/env-utils.ts'\n\nimport { TSESLINT_PRESETS, TSESLINT_RULES } from './ts.ts'\n\n// functions ==================================================================\n\n/**\n * Configuration options for Vue source files.\n */\nexport interface VueOptions {\n\n /**\n * Names of all globally registered directives to be ignored by the rule\n * `vue/no-undef-directives` (without 'v-' prefix).\n */\n globalDirectives?: readonly string[]\n}\n\n// functions ==================================================================\n\n/**\n * Creates configuration objects with linter rules for Vue.js.\n *\n * Wraps the following packages:\n * - `eslint-plugin-vue`\n * - `@vue/eslint-config-typescript`\n *\n * @param rootDir\n * The project root directory.\n *\n * @param stylisticConfig\n * Resolved stylistic configuration options.\n *\n * @param vueOptions\n * Additional configuration for Vue specific rules.\n *\n * @returns\n * The configuration entries to be added to the resulting configuration array.\n */\nexport default function vue(rootDir: string, stylisticConfig: StylisticConfig, vueOptions: VueOptions | undefined): ConfigArg {\n\n // configuration properties\n const { indentOverrides: indent } = stylisticConfig\n\n configureVueProject({ rootDir, allowComponentTypeUnsafety: false })\n\n // recommended configuration of the main plugin\n const recommendedConfigs = vuePlugin.configs['flat/recommended-error']\n\n return defineConfigWithVueTs(\n\n // register rule implementations and recommended rules, raise all recommended rules to 'error' level\n recommendedConfigs.map((config, index) => ({\n ...config,\n name: `core.vue.recommended-${index}`,\n })),\n\n // reconfigure plugin rules\n {\n name: 'core.vue.rules',\n rules: {\n 'no-undef': 'off',\n 'no-unused-vars': 'off',\n 'no-useless-assignment': 'off',\n 'vue/component-api-style': 'error',\n 'vue/define-emits-declaration': 'error',\n 'vue/define-macros-order': 'error',\n 'vue/define-props-declaration': 'error',\n 'vue/eqeqeq': 'error',\n 'vue/html-button-has-type': 'error',\n 'vue/max-attributes-per-line': 'off',\n 'vue/no-console': 'error',\n 'vue/no-duplicate-class-names': 'error',\n 'vue/no-empty-pattern': 'error',\n 'vue/no-implicit-coercion': ['error', NO_IMPLICIT_COERCION_OPTIONS],\n 'vue/no-irregular-whitespace': 'error',\n 'vue/no-literals-in-template': 'error',\n 'vue/no-sparse-arrays': 'error',\n 'vue/no-template-target-blank': 'error',\n 'vue/no-undef-directives': ['error', { ignore: vueOptions?.globalDirectives }],\n 'vue/no-use-v-else-with-v-for': 'error',\n 'vue/no-useless-concat': 'error',\n 'vue/no-useless-v-bind': 'error',\n 'vue/object-shorthand': 'error',\n 'vue/padding-line-between-blocks': 'error',\n 'vue/prefer-define-options': 'error',\n 'vue/prefer-single-event-payload': 'error',\n 'vue/prefer-true-attribute-shorthand': 'error',\n 'vue/prefer-use-template-ref': 'error',\n 'vue/prefer-v-model': 'error',\n 'vue/require-explicit-slots': 'error',\n 'vue/require-typed-ref': 'error',\n 'vue/singleline-html-element-content-newline': 'off',\n // stylistic extensions\n 'vue/array-bracket-spacing': 'error',\n 'vue/arrow-spacing': 'error',\n 'vue/block-spacing': 'error',\n 'vue/brace-style': ['error', '1tbs', { allowSingleLine: true }],\n 'vue/comma-dangle': getCommaDangleConfig(stylisticConfig),\n 'vue/comma-spacing': 'error',\n 'vue/comma-style': 'error',\n 'vue/dot-notation': 'error',\n 'vue/func-call-spacing': 'error',\n 'vue/html-indent': ['error', indent.vue],\n 'vue/key-spacing': ['error', { mode: 'minimum' }],\n 'vue/keyword-spacing': 'error',\n 'vue/object-curly-spacing': ['error', 'always'],\n 'vue/quote-props': ['error', 'as-needed'],\n 'vue/space-in-parens': 'error',\n 'vue/space-infix-ops': 'error',\n 'vue/space-unary-ops': 'error',\n 'vue/template-curly-spacing': 'error',\n // @stylistic plugin\n '@stylistic/indent': ['error', indent.vue, { SwitchCase: 1, MemberExpression: 'off', flatTernaryExpressions: true }],\n },\n },\n\n // create recommended typescript-eslint rules\n ...TSESLINT_PRESETS.map(key => vueTsConfigs[key]),\n\n {\n name: 'core.vue.ts.rules',\n rules: TSESLINT_RULES,\n },\n\n ).map(config => ({ ...config, files: VUE_GLOB })) // restrict all configurations to Vue files\n}\n","\nimport jsonPlugin from 'eslint-plugin-jsonc'\n\nimport type { ConfigArg, StylisticConfig } from '@/eslint/shared/env-utils.ts'\nimport { fixMissingFilesOption } from '@/eslint/shared/env-utils.ts'\n\n// functions ==================================================================\n\n/**\n * Defines standard linting rules for JSON files.\n *\n * Wraps the following packages:\n * - `eslint-plugin-jsonc`\n *\n * @param stylisticConfig\n * Resolved configuration options.\n *\n * @returns\n * The configuration entries to be added to the resulting configuration array.\n */\nexport default function json(stylisticConfig: StylisticConfig): ConfigArg {\n\n // configuration properties\n const { indentOverrides: indent } = stylisticConfig\n\n // add missing 'files' property in configurations with rules (otherwise, plugin conflicts with '@eslint/markdown')\n return fixMissingFilesOption(\n\n // register rule implementations and recommended rules\n jsonPlugin.configs['flat/recommended-with-json'].map((config, index) => ({\n ...config,\n name: `core.json.recommended-${index}`,\n })),\n\n // reconfigure plugin rules\n {\n name: 'core.json.rules',\n rules: {\n 'jsonc/array-bracket-spacing': 'error',\n 'jsonc/comma-style': 'error',\n 'jsonc/indent': ['error', indent.json],\n 'jsonc/key-spacing': ['error', { mode: 'minimum' }],\n 'jsonc/no-irregular-whitespace': 'error',\n 'jsonc/no-octal-escape': 'error',\n },\n },\n\n {\n name: 'core.json.tsconfig',\n files: ['**/tsconfig.json', '**/tsconfig.*.json'],\n rules: {\n 'jsonc/no-comments': 'off',\n },\n },\n )\n}\n","\nimport yamlPlugin from 'eslint-plugin-yml'\n\nimport type { ConfigArg, StylisticConfig } from '@/eslint/shared/env-utils.ts'\nimport { fixMissingFilesOption } from '@/eslint/shared/env-utils.ts'\n\n// functions ==================================================================\n\n/**\n * Defines standard linting rules for YAML files.\n *\n * Wraps the following packages:\n * - `eslint-plugin-yml`\n *\n * @param stylisticConfig\n * Resolved configuration options.\n *\n * @returns\n * The configuration entries to be added to the resulting configuration array.\n */\nexport default function yaml(stylisticConfig: StylisticConfig): ConfigArg {\n\n // configuration properties\n const { indentOverrides: indent } = stylisticConfig\n\n // add missing 'files' property in configurations with rules (otherwise, plugin conflicts with '@eslint/markdown')\n return fixMissingFilesOption(\n\n // register rule implementations and recommended rules\n yamlPlugin.configs.recommended.map((config, index) => ({\n ...config,\n name: `core.yaml.recommended-${index}`,\n })),\n\n // reconfigure plugin rules\n {\n name: 'core.yaml.rules',\n rules: {\n 'yml/indent': ['error', indent.yaml],\n 'yml/key-spacing': ['error', { mode: 'minimum' }],\n 'yml/require-string-key': 'error',\n },\n },\n )\n}\n","\nimport markdownPlugin from '@eslint/markdown'\n\nimport type { ConfigArg } from '@/eslint/shared/env-utils.ts'\n\n// functions ==================================================================\n\n/**\n * Defines standard linting rules for Markdown files.\n *\n * Wraps the following packages:\n * - `@eslint/markdown`\n *\n * @returns\n * The configuration entries to be added to the resulting configuration array.\n */\nexport default function markdown(): ConfigArg {\n return markdownPlugin.configs.recommended.map((config, index) => ({\n ...config,\n name: `core.markdown.recommended-${index}`,\n }))\n}\n","\nimport licensePlugin from 'eslint-plugin-license-header'\n\nimport { type ConfigArg, SRC_GLOB } from '@/eslint/shared/env-utils.ts'\n\n// functions ==================================================================\n\n/**\n * Checks the existence of license headers in source files.\n *\n * Wraps the following packages:\n * - `eslint-plugin-license-header`\n *\n * @param path\n * Absolute path to the template file containing the license header.\n *\n * @returns\n * The configuration entries to be added to the resulting configuration array.\n */\nexport default function license(path: string): ConfigArg {\n\n return {\n name: 'core.license.plugin',\n files: SRC_GLOB,\n\n // register rule implementations of the plugin\n plugins: {\n 'license-header': licensePlugin,\n },\n\n // configure plugin rules\n rules: {\n 'license-header/header': ['error', path],\n },\n }\n}\n","\nimport commentsPluginConfigs from '@eslint-community/eslint-plugin-eslint-comments/configs'\n\nimport { type ConfigArg, SRC_GLOB, VUE_GLOB, createConfig } from '@/eslint/shared/env-utils.ts'\n\n// functions ==================================================================\n\n/**\n * Checks inline linter directives.\n *\n * Wraps the following packages:\n * - `eslint-plugin-eslint-comments`\n *\n * @returns\n * The configuration entries to be added to the resulting configuration array.\n */\nexport default function directives(): ConfigArg {\n\n // register rule implementations and recommended rules\n return createConfig('core.directives.recommended', {\n files: [...SRC_GLOB, ...VUE_GLOB],\n }, commentsPluginConfigs.recommended, {\n '@eslint-community/eslint-comments/disable-enable-pair': ['error', { allowWholeFile: true }],\n })\n}\n","\nimport * as dependPlugin from 'eslint-plugin-depend'\n\nimport type { ConfigArg, PackagesConfig } from '@/eslint/shared/env-utils.ts'\n\n// functions ==================================================================\n\n/**\n * Defines linting rules for outdated or unneeded external dependencies.\n *\n * Wraps the following packages:\n * - `eslint-plugin-depend`\n *\n * @param packagesConfig\n * Resolved configuration options.\n *\n * @returns\n * The configuration entries to be added to the resulting configuration array.\n */\nexport default function packages(packagesConfig: PackagesConfig): ConfigArg {\n\n return [\n\n // register rule implementations and recommended rules\n {\n ...dependPlugin.configs['flat/recommended'],\n name: 'core.packages.recommended',\n },\n\n {\n name: 'core.packages.rules',\n rules: {\n 'depend/ban-dependencies': ['error', {\n modules: packagesConfig.banned,\n allowed: packagesConfig.allowed,\n }],\n },\n },\n ]\n}\n","\nimport * as regexpPlugin from 'eslint-plugin-regexp'\n\nimport { type ConfigArg, SRC_GLOB, convertRuleWarningsToErrors } from '@/eslint/shared/env-utils.ts'\n\n// functions ==================================================================\n\n/**\n * Checks the regular expressions in source files.\n *\n * Wraps the following packages:\n * - `eslint-plugin-regexp`\n *\n * @returns\n * The configuration entries to be added to the resulting configuration array.\n */\nexport default function regexp(): ConfigArg {\n\n // recommended configuration of the plugin\n const recommendedConfig = regexpPlugin.configs.recommended\n\n // register rule implementations and recommended rules\n return {\n files: SRC_GLOB,\n // raise all recommended rules to 'error' level\n ...convertRuleWarningsToErrors(recommendedConfig),\n name: 'core.regexp.recommended',\n }\n}\n","\nimport promisePlugin from 'eslint-plugin-promise'\n\nimport type { ConfigArg } from '@/eslint/shared/env-utils.ts'\n\n// functions ==================================================================\n\n/**\n * Checks for correct usage of native promises.\n *\n * Wraps the following packages:\n * - `eslint-plugin-promise`\n *\n * @returns\n * The configuration entries to be added to the resulting configuration array.\n */\nexport default function promises(): ConfigArg {\n\n return [\n\n // register rule implementations and recommended rules\n {\n ...promisePlugin.configs['flat/recommended'],\n name: 'core.promises.recommended',\n },\n\n // reconfigure plugin rules\n {\n name: 'core.promises.rules',\n rules: {\n 'promise/always-return': ['error', { ignoreLastCallback: true }],\n 'promise/no-callback-in-promise': 'off',\n 'promise/no-nesting': 'error', // warning => error\n 'promise/no-return-in-finally': 'error',\n 'promise/valid-params': 'error', // warning => error\n },\n },\n ]\n}\n","\nimport { jsdoc as jsdocPlugin } from 'eslint-plugin-jsdoc'\n\nimport { type ConfigArg, TS_GLOB, SRC_GLOB } from '@/eslint/shared/env-utils.ts'\n\n// functions ==================================================================\n\n/**\n * Checks the JSDoc comments in source files.\n *\n * Wraps the following packages:\n * - `eslint-plugin-jsdoc`\n *\n * @returns\n * The configuration entries to be added to the resulting configuration array.\n */\nexport default function jsdoc(): ConfigArg {\n\n return [\n\n // register rule implementations and recommended rules\n {\n files: SRC_GLOB,\n ...jsdocPlugin({\n config: 'flat/recommended-error',\n settings: {\n tagNamePreference: {\n // disallowed tags for ES6 keywords `const`, `class`\n augments: false,\n class: false,\n const: false,\n constant: false,\n 'tag constructor': false,\n },\n },\n }),\n name: 'core.jsdoc.recommended',\n },\n\n // overrides for TypeScript files\n {\n files: TS_GLOB,\n ...jsdocPlugin({\n config: 'flat/recommended-typescript-error',\n settings: {\n structuredTags: {\n // '@yields' tags in TypeScript do not need a type\n yields: {\n type: false,\n },\n },\n },\n rules: {\n 'jsdoc/check-param-names': ['error', { allowExtraTrailingParamDocs: true }], // overload signatures\n 'jsdoc/require-yields-type': 'off',\n },\n }),\n name: 'core.jsdoc.typescript',\n },\n\n // configure plugin rules\n // Note: These custom override rules must be located after the TS setup block above (instead of adding them\n // to the 'rules' option inside the leading 'flat/recommended-error' block), otherwise they would be\n // overwritten for all TS files.\n {\n name: 'core.jsdoc.rules',\n files: SRC_GLOB,\n rules: {\n 'jsdoc/check-template-names': 'error',\n 'jsdoc/escape-inline-tags': 'error',\n 'jsdoc/require-asterisk-prefix': 'error',\n 'jsdoc/require-jsdoc': ['error', { contexts: ['ClassDeclaration', 'TSInterfaceDeclaration'] }],\n 'jsdoc/require-template': ['error', { requireSeparateTemplates: true }],\n 'jsdoc/require-template-description': 'error',\n 'jsdoc/require-throws': 'error',\n 'jsdoc/require-throws-description': 'error',\n 'jsdoc/require-yields-description': 'error',\n 'jsdoc/tag-lines': 'off',\n 'jsdoc/ts-no-unnecessary-template-expression': 'error',\n },\n },\n ]\n}\n","\nimport stylisticPlugin from '@stylistic/eslint-plugin'\nimport migratePlugin from '@stylistic/eslint-plugin-migrate'\n\nimport type { ConfigArg, StylisticConfig } from '@/eslint/shared/env-utils.ts'\nimport { getCommaDangleConfig } from '@/eslint/shared/env-utils.ts'\n\n// functions ==================================================================\n\n/**\n * Defines standard (opinionated) linter rules for source code style.\n *\n * Wraps the following packages:\n * - `@stylistic/eslint-plugin`\n * - `@stylistic/eslint-plugin-migrate`\n *\n * @param stylisticConfig\n * Resolved configuration options.\n *\n * @returns\n * The configuration entries to be added to the resulting configuration array.\n */\nexport default function stylistic(stylisticConfig: StylisticConfig): ConfigArg {\n\n // configuration properties\n const { indentOverrides: indent, semi, quotes, funcSpacing } = stylisticConfig\n\n return [\n\n // globally disable all deprecated stylistic core rules\n {\n ...stylisticPlugin.configs['disable-legacy'],\n name: 'core.stylistic.disable-legacy',\n },\n\n // '@stylistic' plugin\n {\n name: 'core.stylistic.recommended',\n\n // do not lint markdown files\n ignores: ['**/*.md'],\n\n // register rule implementations of the plugins\n plugins: {\n '@stylistic': stylisticPlugin,\n },\n\n // configure plugin rules\n rules: {\n '@stylistic/array-bracket-spacing': 'error',\n '@stylistic/arrow-spacing': 'error',\n '@stylistic/block-spacing': 'error',\n '@stylistic/brace-style': ['error', '1tbs', { allowSingleLine: true }],\n '@stylistic/comma-dangle': getCommaDangleConfig(stylisticConfig),\n '@stylistic/comma-spacing': 'error',\n '@stylistic/comma-style': 'error',\n '@stylistic/computed-property-spacing': 'error',\n '@stylistic/eol-last': 'error',\n '@stylistic/function-call-spacing': 'error',\n '@stylistic/generator-star-spacing': 'error',\n '@stylistic/indent': ['error', indent.js, { SwitchCase: 1, MemberExpression: 'off', flatTernaryExpressions: true }],\n '@stylistic/indent-binary-ops': ['error', indent.js],\n '@stylistic/jsx-child-element-spacing': 'error',\n '@stylistic/jsx-curly-brace-presence': 'error',\n '@stylistic/jsx-curly-spacing': 'error',\n '@stylistic/jsx-equals-spacing': 'error',\n '@stylistic/jsx-function-call-newline': 'error',\n '@stylistic/jsx-indent-props': ['error', indent.js],\n '@stylistic/jsx-one-expression-per-line': 'off',\n '@stylistic/jsx-pascal-case': 'error',\n '@stylistic/jsx-quotes': 'error',\n '@stylistic/jsx-self-closing-comp': 'error',\n '@stylistic/jsx-wrap-multilines': 'error',\n '@stylistic/key-spacing': ['error', { mode: 'minimum' }],\n '@stylistic/keyword-spacing': 'error',\n '@stylistic/linebreak-style': 'error',\n '@stylistic/member-delimiter-style': (semi === 'off') ? 'off' : ['error', {\n multiline: { delimiter: (semi === 'always') ? 'semi' : 'none', requireLast: true },\n singleline: { delimiter: (semi === 'always') ? 'semi' : 'comma', requireLast: false },\n }],\n '@stylistic/new-parens': 'error',\n '@stylistic/no-extra-semi': 'error',\n '@stylistic/no-floating-decimal': 'error',\n '@stylistic/no-mixed-operators': ['error', {\n groups: [\n // allow to mix arithmetic operators\n // ['+', '-', '*', '/', '%', '**'],\n ['&', '|', '^', '~', '<<', '>>', '>>>'],\n ['==', '!=', '===', '!==', '>', '>=', '<', '<='],\n ['&&', '||'],\n ['in', 'instanceof'],\n ],\n allowSamePrecedence: true,\n }],\n '@stylistic/no-multiple-empty-lines': ['error', { max: 2 }],\n '@stylistic/no-tabs': 'error',\n '@stylistic/no-trailing-spaces': 'error',\n '@stylistic/no-whitespace-before-property': 'error',\n '@stylistic/object-curly-spacing': ['error', 'always'],\n '@stylistic/quote-props': ['error', 'as-needed'],\n '@stylistic/quotes': (quotes === 'off') ? 'off' : ['error', quotes, { avoidEscape: true }],\n '@stylistic/rest-spread-spacing': 'error',\n '@stylistic/semi': (semi === 'off') ? 'off' : ['error', semi],\n '@stylistic/semi-spacing': 'error',\n '@stylistic/semi-style': 'error',\n '@stylistic/space-before-blocks': 'error',\n '@stylistic/space-before-function-paren': ['error', {\n anonymous: 'always',\n named: (funcSpacing === 'off') ? 'ignore' : funcSpacing,\n asyncArrow: 'always',\n catch: 'always',\n }],\n '@stylistic/space-in-parens': 'error',\n '@stylistic/space-infix-ops': 'error',\n '@stylistic/space-unary-ops': 'error',\n '@stylistic/switch-colon-spacing': 'error',\n '@stylistic/template-curly-spacing': 'error',\n '@stylistic/template-tag-spacing': 'error',\n '@stylistic/type-annotation-spacing': 'error',\n '@stylistic/type-generic-spacing': 'error',\n '@stylistic/type-named-tuple-spacing': 'error',\n '@stylistic/wrap-iife': 'error',\n '@stylistic/yield-star-spacing': 'error',\n },\n },\n\n // '@stylistic/migrate' plugin\n {\n name: 'core.stylistic.migrate',\n\n // register rule implementations of the plugins\n plugins: {\n '@stylistic/migrate': migratePlugin,\n },\n\n // configure plugin rules\n rules: {\n '@stylistic/migrate/migrate-js': 'error',\n '@stylistic/migrate/migrate-ts': 'error',\n '@stylistic/migrate/migrate-jsx': 'error',\n },\n },\n ]\n}\n","\nimport nodePlugin from 'eslint-plugin-n'\nimport type ts from 'typescript'\n\nimport type { ConfigArg, LanguageOptions } from '@/eslint/shared/env-utils.ts'\nimport { createConfig, customRules } from '@/eslint/shared/env-utils.ts'\nimport { type EnvRestrictedOptions, restrictedRulesConfig } from '@/eslint/shared/restricted.ts'\n\n// types ======================================================================\n\nexport type EnvNodeConvertPathPattern = [pattern: string, replacement: string]\n\n/**\n * Configuration for the record-style setting 'convertPath' of the plugin\n * `eslint-plugin-n`.\n */\nexport type EnvNodeConvertPathRecord = Record<string, EnvNodeConvertPathPattern>\n\n/**\n * Configuration for the elements in the array-style setting 'convertPath' of\n * the plugin `eslint-plugin-n`.\n */\nexport interface EnvNodeConvertPathElement {\n include: string[]\n exclude?: string[]\n replace: EnvNodeConvertPathPattern\n}\n\n/**\n * Shared settings for the plugin `eslint-plugin-n`.\n */\nexport interface EnvNodeSharedSettings {\n version?: string\n allowModules?: string[]\n resolvePaths?: string[]\n convertPath?: EnvNodeConvertPathRecord | EnvNodeConvertPathElement[]\n tryExtensions?: string[]\n tsconfigPath?: string[]\n typescriptExtensionMap?: ts.server.protocol.JsxEmit | Array<[string, string]>\n}\n\n/**\n * Configuration options for the environment preset 'env.node'.\n */\nexport interface EnvNodeOptions extends EnvRestrictedOptions {\n\n /**\n * The module mode used by the linted files.\n *\n * @default 'module'\n */\n sourceType?: LanguageOptions['sourceType']\n\n /**\n * Shared settings for the plugin `eslint-plugin-n`. Will be merged into the\n * settings object with the key 'n'.\n */\n settings?: EnvNodeSharedSettings\n}\n\n// functions ==================================================================\n\n/**\n * Creates configuration objects with global symbols and linter rules for\n * NodeJS modules.\n *\n * Wraps the following packages:\n * - `eslint-plugin-n`\n *\n * @param envOptions\n * Configuration options for the environment.\n *\n * @returns\n * The configuration entries to be added to the resulting configuration array.\n */\nexport default function node(envOptions: EnvNodeOptions): ConfigArg {\n\n // the plugin configuration key, according to source module type\n const configKey = (envOptions.sourceType === 'commonjs') ? 'flat/recommended-script' : 'flat/recommended-module'\n\n return [\n\n // register rule implementations\n createConfig('env.node.recommended', envOptions, {\n ...nodePlugin.configs[configKey],\n settings: {\n n: {\n tryExtensions: ['.js', '.ts', '.d.ts'], // automatically add missing extensions in imports\n ...envOptions.settings,\n },\n },\n }),\n\n // generate the 'no-restricted-?' rules according to passed configuration\n restrictedRulesConfig('env.node.restricted', envOptions),\n\n // custom rules\n customRules('env.node.rules', envOptions, {\n 'no-console': 'off',\n 'n/no-missing-import': 'off',\n 'n/no-unsupported-features/node-builtins': ['error', { allowExperimental: true }],\n 'n/prefer-global/buffer': 'error',\n 'n/prefer-global/console': 'error',\n 'n/prefer-global/crypto': 'error',\n 'n/prefer-global/process': 'error',\n 'n/prefer-global/text-decoder': 'error',\n 'n/prefer-global/text-encoder': 'error',\n 'n/prefer-global/timers': 'error',\n 'n/prefer-global/url': 'error',\n 'n/prefer-global/url-search-params': 'error',\n 'n/prefer-node-protocol': 'error',\n }),\n ]\n}\n","\nimport JAVASCRIPT_GLOBALS from 'globals'\nimport CONFUSING_BROWSER_GLOBALS from 'confusing-browser-globals'\nimport sanitizedPlugin from 'eslint-plugin-no-unsanitized'\n\nimport { type ConfigArg, createConfig, customRules } from '@/eslint/shared/env-utils.ts'\nimport type { EnvRestrictedName, EnvRestrictedProperty, EnvRestrictedSyntax, EnvRestrictedOptions } from '@/eslint/shared/restricted.ts'\nimport { restrictedRulesConfig } from '@/eslint/shared/restricted.ts'\n\n// types ======================================================================\n\n/**\n * Configuration options for the environment preset 'env.browser'.\n */\nexport interface EnvBrowserOptions extends EnvRestrictedOptions { }\n\n// constants ==================================================================\n\n/**\n * Global builtin symbols that are confusing or deprecated.\n */\nconst CONFUSING_BUILTIN_GLOBALS: readonly string[] = [\n 'constructor',\n 'escape',\n 'eval',\n 'hasOwnProperty',\n 'isPrototypeOf',\n 'origin',\n 'propertyIsEnumerable',\n 'toLocaleString',\n 'toString',\n 'unescape',\n 'valueOf',\n]\n\n/**\n * Global browser classes that may conflict with custom application classes.\n * For disambiguation, custom classes must be imported, and global browser\n * classes must be used with their fully qualified name.\n */\nconst AMBIGUOUS_BROWSER_TYPES: readonly string[] = [\n 'Position',\n 'Point',\n 'Size',\n 'Range',\n]\n\n/**\n * Properties of global objects to be banned in all browser modules.\n */\nconst RESTRICTED_PROPERTIES: EnvRestrictedProperty[] = []\n\n/**\n * Syntax constructs to be banned in all browser modules.\n */\nconst RESTRICTED_SYNTAX: EnvRestrictedSyntax[] = [\n { selector: 'ExportNamedDeclaration > TSEnumDeclaration[const=true]', message: 'Do not export const enums.' },\n]\n\n// initialization =============================================================\n\n/**\n * All supported global browser symbols intended to be used without fully\n * qualified name (e.g. `HTMLElement` instead of `window.HTMLElement`).\n * A few confusing globals will be filtered though, especially symbols with\n * common names (e.g. `name`, `event`, etc.) to be able to catch missing or\n * misspelled variables or parameter names.\n */\nconst BROWSER_GLOBALS: Record<string, 'readonly'> = {}\n\n// Add all builtin ES globals.\nfor (const name of Object.keys(JAVASCRIPT_GLOBALS.builtin)) {\n BROWSER_GLOBALS[name] = 'readonly'\n}\n\n// Add browser globals (skip writable properties, e.g. window event handlers).\nfor (const [name, writable] of Object.entries(JAVASCRIPT_GLOBALS.browser)) {\n if (!writable) BROWSER_GLOBALS[name] = 'readonly'\n}\n\n// Remove commonly known confusing or deprecated builtin globals.\nfor (const name of CONFUSING_BUILTIN_GLOBALS) {\n delete BROWSER_GLOBALS[name]\n}\n\n// Remove commonly known confusing browser globals (e.g. `name`, `event`).\nfor (const name of CONFUSING_BROWSER_GLOBALS) {\n delete BROWSER_GLOBALS[name]\n}\n\n// Create the configuration list for rule 'no-restricted-globals'.\nconst RESTRICTED_GLOBALS: EnvRestrictedName[] = AMBIGUOUS_BROWSER_TYPES.map(name => {\n const message = `Import custom type '${name}', or use 'globalThis.${name}' for disambiguation.`\n return { name, message }\n})\n\n// functions ==================================================================\n\n/**\n * Creates configuration objects with global symbols and linter rules for for\n * browser modules.\n *\n * Wraps the following packages:\n * - `globals`\n * - `confusing-browser-globals`\n * - `eslint-plugin-no-unsanitized`\n *\n * @param envOptions\n * Configuration options for the environment.\n *\n * @returns\n * The configuration entries to be added to the resulting configuration array.\n */\nexport default function browser(envOptions: EnvBrowserOptions): ConfigArg {\n\n return [\n\n // register global symbols used in browser scripts\n createConfig('env.browser.globals', envOptions, {\n languageOptions: {\n globals: BROWSER_GLOBALS,\n },\n }),\n\n // generate the 'no-restricted-?' rules according to passed configuration\n restrictedRulesConfig('env.browser.restricted', envOptions, {\n globals: RESTRICTED_GLOBALS,\n properties: RESTRICTED_PROPERTIES,\n syntax: RESTRICTED_SYNTAX,\n }),\n\n // register rule implementations and recommended rules\n createConfig('env.browser.sanitized', envOptions, sanitizedPlugin.configs.recommended),\n\n // custom rules\n customRules('env.browser.rules', envOptions),\n ]\n}\n","\nimport extendedPlugin from 'eslint-plugin-jest-extended'\nimport jestDomPlugin from 'eslint-plugin-jest-dom'\nimport testingLibraryPlugin from 'eslint-plugin-testing-library'\n\nimport type { ConfigArg, EnvBaseOptions } from './env-utils.ts'\nimport { createConfig, customRules } from './env-utils.ts'\n\n// types ======================================================================\n\n/**\n * Shared options for environment presets for unit tests.\n */\nexport interface EnvUnitTestOptions extends EnvBaseOptions {\n\n /**\n * Specifies whether to include `eslint-plugin-jest-extended`. Should only be\n * used, if the package `jest-extended` has been installed in the project.\n *\n * @default false\n */\n jestExtended?: boolean\n\n /**\n * Specifies whether to include `eslint-plugin-jest-dom`. Should only be\n * used, if the package `@testing-library/jest-dom` has been installed in the\n * project.\n *\n * @default false\n */\n jestDom?: boolean\n\n /**\n * Specifies the recommended rule set of `eslint-plugin-testing-library` to\n * be included.\n */\n testingLib?: 'angular' | 'dom' | 'marko' | 'react' | 'vue'\n}\n\n// functions ==================================================================\n\n/**\n * Conditionally creates configuration entries for the ESLint plugins\n * `eslint-plugin-jest-dom` and `eslint-plugin-testing-library`.\n *\n * @param baseName\n * The base name for all configuration entries.\n *\n * @param envOptions\n * The configuration options for the unit test environment.\n *\n * @returns\n * The resulting configuration entries.\n */\nexport function createUnitTestPluginConfigs(baseName: string, envOptions: EnvUnitTestOptions): ConfigArg {\n\n return [\n\n // do not require strict documentation in unit tests\n customRules(`${baseName}.jsdoc`, envOptions, {\n 'jsdoc/require-jsdoc': 'off',\n 'jsdoc/require-param': 'off',\n }),\n\n // 'jest-extended' plugin (config 'flat/recommended' is empty)\n envOptions.jestExtended && createConfig(`${baseName}.extended`, envOptions, extendedPlugin.configs['flat/all']),\n\n // 'jest-dom' plugin\n envOptions.jestDom && createConfig(`${baseName}.jest-dom`, envOptions, jestDomPlugin.configs['flat/recommended'], {\n 'jest-dom/prefer-to-have-class': 'off', // TODO: crashes with ESLint v10 (dead project: https://github.com/testing-library/eslint-plugin-jest-dom/pull/415)\n }),\n\n // 'testing-library' plugin\n envOptions.testingLib && createConfig(`${baseName}.testing-library`, envOptions, {\n // register rule implementations of the plugins\n plugins: {\n 'testing-library': testingLibraryPlugin,\n },\n // recommended rules\n rules: {\n ...testingLibraryPlugin.configs[`flat/${envOptions.testingLib}`].rules,\n 'testing-library/no-node-access': ['error', { allowContainerFirstChild: true }],\n 'testing-library/prefer-user-event-setup': 'error',\n },\n }),\n ]\n}\n","\nimport jestPlugin from 'eslint-plugin-jest'\n\nimport { type ConfigArg, JS_GLOB, createConfig, customRules } from '@/eslint/shared/env-utils.ts'\nimport { type EnvUnitTestOptions, createUnitTestPluginConfigs } from '@/eslint/shared/unittest.ts'\n\n// types ======================================================================\n\n/**\n * Configuration options for the environment preset 'env.jest'.\n */\nexport interface EnvJestOptions extends EnvUnitTestOptions { }\n\n// functions ==================================================================\n\n/**\n * Creates configuration objects with global symbols and linter rules for unit\n * tests using Jest.\n *\n * Wraps the following packages:\n * - `eslint-plugin-jest`\n * - `eslint-plugin-jest-extended`\n * - `eslint-plugin-jest-dom`\n * - `eslint-plugin-testing-library`\n *\n * @param envOptions\n * Configuration options for the environment.\n *\n * @returns\n * The configuration entries to be added to the resulting configuration array.\n */\nexport default function jest(envOptions: EnvJestOptions): ConfigArg {\n\n return [\n\n // register rule implementations, globals, and recommended rules\n createConfig('env.jest.recommended', envOptions, jestPlugin.configs['flat/recommended']),\n\n // add recommended stylistic rules\n createConfig('env.jest.stylistic', envOptions, jestPlugin.configs['flat/style']),\n\n // 'jest-dom' and 'testing-library' plugin\n createUnitTestPluginConfigs('env.jest', envOptions),\n\n // custom rules\n customRules('env.jest.rules', envOptions, {\n // 'jest' plugin\n 'jest/consistent-test-it': ['error', { fn: 'it' }],\n 'jest/expect-expect': ['error', { assertFunctionNames: ['expect*'] }],\n 'jest/no-commented-out-tests': 'error',\n 'jest/no-conditional-expect': 'off',\n 'jest/no-confusing-set-timeout': 'error',\n 'jest/no-duplicate-hooks': 'error',\n 'jest/no-unneeded-async-expect-function': 'error',\n 'jest/no-test-return-statement': 'error',\n 'jest/prefer-comparison-matcher': 'error',\n 'jest/prefer-equality-matcher': 'error',\n 'jest/prefer-expect-resolves': 'error',\n 'jest/prefer-hooks-on-top': 'error',\n 'jest/prefer-jest-mocked': 'error',\n 'jest/prefer-lowercase-title': 'error',\n 'jest/prefer-mock-promise-shorthand': 'error',\n 'jest/prefer-mock-return-shorthand': 'error',\n 'jest/prefer-spy-on': 'error',\n 'jest/prefer-todo': 'error',\n 'jest/require-top-level-describe': 'error',\n }),\n\n // enable type-aware rules for TS files\n createConfig('env.jest.typescript', envOptions, {\n ignores: JS_GLOB,\n rules: {\n 'jest/no-error-equal': 'error',\n 'jest/no-unnecessary-assertion': 'error',\n 'jest/unbound-method': 'error',\n '@typescript-eslint/unbound-method': 'off', // replaced by 'jest/unbound-method'\n },\n }),\n ]\n}\n","\nimport vitestPlugin from '@vitest/eslint-plugin'\n\nimport { type ConfigArg, JS_GLOB, createConfig, customRules } from '@/eslint/shared/env-utils.ts'\nimport { type EnvUnitTestOptions, createUnitTestPluginConfigs } from '@/eslint/shared/unittest.ts'\n\n// types ======================================================================\n\n/**\n * Configuration options for the environment preset 'env.vitest'.\n */\nexport interface EnvVitestOptions extends EnvUnitTestOptions { }\n\n// functions ==================================================================\n\n/**\n * Creates configuration objects with global symbols and linter rules for unit\n * tests using Vitest.\n *\n * Wraps the following packages:\n * - `eslint-plugin-vitest`\n * - `eslint-plugin-jest-extended`\n * - `eslint-plugin-jest-dom`\n * - `eslint-plugin-testing-library`\n *\n * @param envOptions\n * Configuration options for the environment.\n *\n * @returns\n * The configuration entries to be added to the resulting configuration array.\n */\nexport default function vitest(envOptions: EnvVitestOptions): ConfigArg {\n\n return [\n\n // 'vitest' plugin\n createConfig('env.vitest.recommended', envOptions, {\n // register rule implementations of the plugins\n plugins: {\n vitest: vitestPlugin,\n },\n // register global symbols of Vitest\n languageOptions: {\n globals: vitestPlugin.environments.env.globals,\n },\n // recommended rules\n rules: vitestPlugin.configs.recommended.rules,\n }),\n\n // 'jest-dom' and 'testing-library' plugin\n createUnitTestPluginConfigs('env.vitest', envOptions),\n\n // allow to add type-checking expectations in tests\n createConfig('env.vitest.type-check', envOptions, {\n ignores: JS_GLOB,\n settings: {\n vitest: {\n typecheck: true,\n },\n },\n }),\n\n // custom rules\n customRules('env.vitest.rules', envOptions, {\n // 'vitest' plugin\n 'vitest/consistent-test-it': 'error',\n 'vitest/expect-expect': ['error', { assertFunctionNames: ['expect*'] }],\n 'vitest/no-alias-methods': 'error',\n 'vitest/no-disabled-tests': 'warn',\n 'vitest/no-duplicate-hooks': 'error',\n 'vitest/no-focused-tests': 'error',\n 'vitest/no-standalone-expect': 'error',\n 'vitest/no-test-prefixes': 'error',\n 'vitest/no-test-return-statement': 'error',\n 'vitest/prefer-comparison-matcher': 'error',\n 'vitest/prefer-each': 'error',\n 'vitest/prefer-equality-matcher': 'error',\n 'vitest/prefer-expect-resolves': 'error',\n 'vitest/prefer-hooks-in-order': 'error',\n 'vitest/prefer-hooks-on-top': 'error',\n 'vitest/prefer-import-in-mock': 'error',\n 'vitest/prefer-mock-promise-shorthand': 'error',\n 'vitest/prefer-mock-return-shorthand': 'error',\n 'vitest/prefer-spy-on': 'error',\n 'vitest/prefer-strict-equal': 'error',\n 'vitest/prefer-to-be': 'error',\n 'vitest/prefer-to-contain': 'error',\n 'vitest/prefer-to-have-length': 'error',\n 'vitest/prefer-vi-mocked': 'error',\n 'vitest/require-top-level-describe': 'error',\n 'vitest/valid-expect-in-promise': 'error',\n }),\n ]\n}\n","\nimport codeceptPlugin from 'eslint-plugin-codeceptjs'\nimport chaiExpectPlugin from 'eslint-plugin-chai-expect'\n\nimport type { ConfigArg, EnvBaseOptions } from '@/eslint/shared/env-utils.ts'\nimport { createConfig, customRules } from '@/eslint/shared/env-utils.ts'\n\n// types ======================================================================\n\n/**\n * Configuration options for the environment preset 'env.codecept'.\n */\nexport interface EnvCodeceptOptions extends EnvBaseOptions { }\n\n// functions ==================================================================\n\n/**\n * Creates configuration objects with global symbols and linter rules for E2E\n * tests using CodeceptJS.\n *\n * Wraps the following packages:\n * - `eslint-plugin-codeceptjs`\n * - `eslint-plugin-chai-expect`\n *\n * @param envOptions\n * Configuration options for the environment.\n *\n * @returns\n * The configuration entries to be added to the resulting configuration array.\n */\nexport default function codecept(envOptions: EnvCodeceptOptions): ConfigArg {\n\n return [\n\n // 'codecept' plugin\n createConfig('env.codecept.plugin', envOptions, {\n // register rule implementations of the plugins\n plugins: {\n codeceptjs: codeceptPlugin,\n },\n // register global symbols of CodeceptJS\n languageOptions: {\n globals: codeceptPlugin.environments.codeceptjs.globals,\n },\n // recommended rules\n rules: codeceptPlugin.configs.recommended.rules,\n }),\n\n // 'chai-expect' plugin\n createConfig('env.codecept.chai-expect', envOptions, chaiExpectPlugin.configs['recommended-flat']),\n\n // custom rules\n customRules('env.codecept.rules', envOptions, {\n 'new-cap': ['error', {\n capIsNewExceptions: ['After', 'AfterSuite', 'Before', 'BeforeSuite', 'Feature', 'Scenario'],\n }],\n 'no-restricted-properties': ['warn', { object: 'Scenario', property: 'todo', message: 'Unexpected unimplemented test.' }],\n 'codeceptjs/no-skipped-tests': 'warn',\n // do not require strict documentation in e2e tests\n 'jsdoc/require-jsdoc': 'off',\n 'jsdoc/require-param': 'off',\n }),\n ]\n}\n","\nimport { posix, sep, dirname, extname } from 'node:path'\nimport { lstatSync } from 'node:fs'\nimport { createRequire } from 'node:module'\n\nimport pm, { type Glob } from 'picomatch'\nimport * as find from 'empathic/find'\n\nimport type { JSONSchema, TSESTree, TSESLint } from '@typescript-eslint/utils'\nimport { AST_NODE_TYPES as NodeType } from '@typescript-eslint/utils'\n\n// types ======================================================================\n\nexport type OptASTNode = TSESTree.Node | null | undefined\n\n/**\n * Shared settings used by multiple rules.\n */\nexport interface SharedRuleSettings {\n\n /**\n * Maps all alias prefixes to actual paths in the project.\n */\n alias?: Record<string, string>\n}\n\n// ----------------------------------------------------------------------------\n\nexport type ImportExportNode =\n | TSESTree.ImportDeclaration\n | TSESTree.ImportExpression\n | TSESTree.ExportAllDeclaration\n | TSESTree.ExportNamedDeclaration\n | TSESTree.TSExternalModuleReference\n\n// constants ==================================================================\n\nconst FILE_EXTENSIONS = ['js', 'ts', 'd.ts']\n\nconst CONFIG_FILES: string[] = [\n 'eslint.config.js',\n 'eslint.config.mjs',\n 'eslint.config.cjs',\n 'eslint.config.ts',\n 'eslint.config.mts',\n 'eslint.config.cts',\n]\n\n// Schema =====================================================================\n\n/**\n * Helper functions to build a JSON schema for custom ESLint rules.\n */\nexport const Schema = {\n\n boolean(): JSONSchema.JSONSchema4BooleanSchema {\n return { type: 'boolean' }\n },\n\n string(): JSONSchema.JSONSchema4StringSchema {\n return { type: 'string' }\n },\n\n stringNE(): JSONSchema.JSONSchema4StringSchema {\n return { type: 'string', minLength: 1 }\n },\n\n array(items: JSONSchema.JSONSchema4): JSONSchema.JSONSchema4ArraySchema {\n return { type: 'array', items, uniqueItems: true }\n },\n\n maybeArray(items: JSONSchema.JSONSchema4): JSONSchema.JSONSchema4OneOfSchema {\n return { oneOf: [items, Schema.array(items)] }\n },\n\n dictionary(properties: JSONSchema.JSONSchema4): JSONSchema.JSONSchema4ObjectSchema {\n return { type: 'object', additionalProperties: properties }\n },\n\n options(properties: Record<string, JSONSchema.JSONSchema4>, required?: boolean | string[]): JSONSchema.JSONSchema4ObjectSchema {\n return { type: 'object', properties, required, additionalProperties: false }\n },\n}\n\n// functions ==================================================================\n\n/**\n * Returns whether the passed AST node is an `Identifier `node.\n *\n * @param node\n * The AST node to be checked.\n *\n * @returns\n * Whether the passed AST node is an `Identifier` node.\n */\nexport function isIdentifier(node: OptASTNode): node is TSESTree.Identifier {\n return node?.type === NodeType.Identifier\n}\n\n/**\n * Returns whether the passed AST node is a `Literal` node.\n *\n * @param node\n * The AST node to be checked.\n *\n * @returns\n * Whether the passed AST node is a `Literal` node.\n */\nexport function isLiteral(node: OptASTNode): node is TSESTree.Literal {\n return node?.type === NodeType.Literal\n}\n\n/**\n * Returns whether the passed AST node is a `Literal` node with a specific\n * constant value.\n *\n * @param node\n * The AST node to be checked.\n *\n * @param value\n * The expected literal value.\n *\n * @returns\n * Whether the passed AST node is a `Literal` node with a constant value.\n */\nexport function isLiteralValue(node: TSESTree.Node, value: unknown): node is TSESTree.Literal {\n return isLiteral(node) && (node.value === value)\n}\n\n/**\n * Returns whether the passed AST node is an `AssignmentExpression` node.\n *\n * @param node\n * The AST node to be checked.\n *\n * @returns\n * Whether the passed AST node is an `AssignmentExpression` node.\n */\nexport function isAssignmentExpression(node: OptASTNode): node is TSESTree.AssignmentExpression {\n return node?.type === NodeType.AssignmentExpression\n}\n\n/**\n * Returns whether the passed AST node is a `MemberExpression` node.\n *\n * @param node\n * The AST node to be checked.\n *\n * @returns\n * Whether the passed AST node is a `MemberExpression` node.\n */\nexport function isMemberExpression(node: OptASTNode): node is TSESTree.MemberExpression {\n return node?.type === NodeType.MemberExpression\n}\n\n/**\n * Returns a passed array unmodified, converts the value `undefined` to an\n * empty array, and converts all other values to an array with one element.\n *\n * @template T\n * The type of the array elements.\n *\n * @param value\n * Any value to be converted to an array.\n *\n * @returns\n * An array containing the value, unless the value is already an array.\n */\nexport function makeArray<T>(value: T | T[] | undefined): T[] {\n return Array.isArray(value) ? value : (value === undefined) ? [] : [value]\n}\n\n/**\n * Converts a Windows file path to a Posix file path.\n *\n * @param path\n * The file path to be normalized to Posix format.\n *\n * @returns\n * The normalized Posix file path.\n */\nexport function toPosixPath(path: string): string {\n return path.replaceAll(sep, posix.sep)\n}\n\n/**\n * Returns whether the passed path refers to an existing file.\n *\n * @param path\n * The path to be checked.\n *\n * @returns\n * Whether the passed path refers to an existing file (returns `false` for\n * existing directories).\n */\nexport function isFile(path: string): boolean {\n try {\n return lstatSync(path).isFile()\n } catch {\n return false\n }\n}\n\n// class ImportNodeWrapper ====================================================\n\n/**\n * A wrapper for an `import` statement containing a string literal node with a\n * module name, and the resulting extracted module name.\n */\nexport class ImportNodeWrapper {\n\n /** The string literal node containing the name of the imported module. */\n readonly sourceNode: TSESTree.StringLiteral\n\n /** The original name of the imported module (with alias key). */\n readonly moduleName: string\n\n // constructor ------------------------------------------------------------\n\n constructor(node: TSESTree.StringLiteral) {\n this.sourceNode = node\n // strip URL query strings from module name\n this.moduleName = node.value.replace(/\\?.*$/, '')\n }\n\n // public methods ---------------------------------------------------------\n\n /**\n * Returns whether the name of the imported module matches the specified glob\n * patterns.\n *\n * @param patterns\n * The glob patterns to be matched against the module name.\n *\n * @returns\n * Whether the name of the wrapped module matches at least one glob\n * pattern.\n */\n matchModuleName(patterns: Glob): boolean {\n return pm.isMatch(this.moduleName, patterns)\n }\n}\n\n// class ProjectContext =======================================================\n\n/**\n * A custom context helper for the linter rules of the preset environment\n * 'env.project'.\n *\n * @param context\n * The rule context of the module currently linted.\n */\nexport class ProjectContext {\n\n /** Maps alias keys to alias paths. */\n readonly #aliasMap: Map<string, string>\n\n /** Root directory containing the linter configuration file. */\n readonly #rootDir: string\n\n /** Absolute path to the linter configuration file. */\n readonly #configPath: string\n\n /** The name of the linted module (with alias prefix if available). */\n readonly #moduleName: string\n\n /** Resolver for npm packages. */\n #requireModule: NodeJS.Require | undefined\n\n // constructor ------------------------------------------------------------\n\n constructor(context: Readonly<TSESLint.RuleContext<any, any>>) {\n\n // convert 'alias' option to map\n const sharedSettings = context.settings['env-project'] as SharedRuleSettings | undefined\n this.#aliasMap = new Map(Object.entries(sharedSettings?.alias ?? {}))\n\n // resolve root directory\n const configPath = find.any(CONFIG_FILES)\n if (!configPath) {\n throw new Error('cannot find configuration file')\n }\n const rootDir = toPosixPath(dirname(configPath))\n const fileName = toPosixPath(context.filename)\n if (!fileName.startsWith(rootDir + '/')) {\n throw new Error('invalid root directory')\n }\n this.#rootDir = rootDir\n this.#configPath = configPath\n\n // path of current module (slice rootDir with '/' from start, and extension with '.' from end)\n const fileExt = extname(fileName)\n const selfModulePath = fileName.slice(rootDir.length + 1, -fileExt.length)\n if (!selfModulePath) {\n throw new Error('invalid own module path')\n }\n\n // replace alias path with alias key\n this.#moduleName = selfModulePath\n for (const [aliasKey, aliasPath] of this.#aliasMap) {\n if (selfModulePath.startsWith(aliasPath + '/')) {\n this.#moduleName = aliasKey + '/' + selfModulePath.slice(aliasPath.length + 1)\n break\n }\n }\n }\n\n // public methods ---------------------------------------------------------\n\n /**\n * Extracts the source node and module name of an import/export statement\n * node, or a dynamic import expression node.\n *\n * @param node\n * The import/export statement node, or dynamic import expression node.\n *\n * @returns\n * The string literal node containing the module name, and the resulting\n * extracted module name.\n */\n resolveImportNode(node: ImportExportNode): ImportNodeWrapper | undefined {\n\n // TSExternalModuleReference: module name in property 'expression', otherwise 'source'\n const sourceNodeRaw = (node.type === NodeType.TSExternalModuleReference) ? node.expression : node.source\n\n // module name is expected to be a string literal\n const isStringLiteral = (sourceNodeRaw?.type === NodeType.Literal) && (typeof sourceNodeRaw.value === 'string')\n return isStringLiteral ? new ImportNodeWrapper(sourceNodeRaw) : undefined\n }\n\n /**\n * Extracts an existing alias key, and resolves the module path of a module\n * name.\n *\n * @param moduleName\n * The module name to extract an alias key from.\n *\n * @returns\n * A pair containing the alias key (empty string if no alias found), and the\n * resolved module path (passed module name if no alias found).\n */\n resolveAlias(moduleName: string): [string, string] {\n const [key, ...rest] = moduleName.split('/')\n const aliasPath = (key && rest[0]) ? this.#aliasMap.get(key) : undefined\n const aliasKey = aliasPath ? key : ''\n const modulePath = aliasPath ? posix.join(aliasPath, ...rest) : moduleName\n return [aliasKey, modulePath]\n }\n\n /**\n * Returns whether the name of the module currently linted matches the\n * specified glob patterns.\n *\n * @param patterns\n * The glob patterns to be matched against the current module name.\n *\n * @returns\n * Whether the current module name matches at least one glob pattern.\n */\n matchModuleName(patterns: Glob): boolean {\n return pm.isMatch(this.#moduleName, patterns)\n }\n\n /**\n * Returns whether a source file exists for the specified module.\n *\n * @param modulePath\n * The resolved module path (alias key replaced with path).\n *\n * @returns\n * Whether a source file exists for the specified module.\n */\n fileExists(modulePath: string): boolean {\n // check modules with explicit extension\n const resolvedPath = posix.join(this.#rootDir, modulePath)\n if (extname(modulePath)) return isFile(resolvedPath)\n // search for a file with a known extension\n return FILE_EXTENSIONS.some(ext => isFile(resolvedPath + '.' + ext))\n }\n\n /**\n * Returns whether the passed module name is an installed npm package.\n *\n * @param moduleName\n * The module name to be checked.\n *\n * @returns\n * Whether the passed module name is an installed npm package.\n */\n packageExists(moduleName: string): boolean {\n this.#requireModule ??= createRequire(this.#configPath)\n try {\n this.#requireModule.resolve(moduleName)\n return true\n } catch {\n return false\n }\n }\n}\n","\nimport { AST_NODE_TYPES as NodeType } from '@typescript-eslint/utils'\nimport type { RuleFunction } from '@eslint-react/kit'\n\nimport { isLiteralValue } from '@/eslint/shared/rule-utils'\n\n// functions ==================================================================\n\n/**\n * Enforce shorthand notation for boolean JSX attributes.\n *\n * @returns\n * The rule implementation.\n */\nexport default function jsxShorthandBoolean(): RuleFunction {\n\n // @eslint-react plugin injects the toolkit\n return (context, toolkit) => ({\n JSXAttribute(node) {\n\n // check attribute expressions only\n const value = node.value\n if (value?.type !== NodeType.JSXExpressionContainer) return\n\n // unwrap expression root node from TypeScript type augmentations\n const expression = toolkit.ast.unwrap(value.expression)\n\n // trigger for literal value `true` only\n if (isLiteralValue(expression, true)) {\n context.report({\n node,\n message: 'Omit the value for boolean attributes.',\n fix: fixer => fixer.removeRange([node.name.range[1], value.range[1]]),\n })\n }\n },\n })\n}\n","\nimport { type RuleFunction, merge } from '@eslint-react/kit'\nimport { isIdentifier, isAssignmentExpression, isMemberExpression } from '@/eslint/shared/rule-utils'\n\n// functions ==================================================================\n\n/**\n * Enforce destructuring assignment for component props.\n *\n * @returns\n * The rule implementation.\n */\nexport default function preferDestructuringAssignment(): RuleFunction {\n\n // @eslint-react plugin injects the toolkit\n return (context, toolkit) => {\n\n // collect all function components in the source file while traversing\n const components = toolkit.collect.components(context)\n\n return merge(components.visitor, {\n 'Program:exit'(program) {\n\n // process all collected function components\n for (const component of components.query.all(program)) {\n\n // inspect the first function parameter (skip direct destructuring)\n const param = component.node.params[0]\n if (!isIdentifier(param)) continue\n\n // find the scope of the parameter containing all access references\n const scope = context.sourceCode.getScope(component.node)\n const variable = scope.variables.find(v => v.name === param.name)\n if (!variable?.references) continue\n\n // check all access references\n for (const reference of variable.references) {\n\n // must be part of a member expression\n const parent = reference.identifier.parent\n if (!isMemberExpression(parent)) continue\n\n // ignore assignments (will be caught by 'immutable' rule)\n if (isAssignmentExpression(parent.parent) && (parent === parent.parent.left)) continue\n\n context.report({\n node: parent,\n message: 'Use destructuring assignment for component props.',\n })\n }\n }\n },\n })\n }\n}\n","\nimport reactPlugin from '@eslint-react/eslint-plugin'\nimport reactKit from '@eslint-react/kit'\nimport reactHooksPlugin from 'eslint-plugin-react-hooks'\nimport { reactRefresh } from 'eslint-plugin-react-refresh'\nimport jsxA11yPlugin from 'eslint-plugin-jsx-a11y'\nimport { parser } from 'typescript-eslint'\n\nimport type { ConfigArg, EnvBaseOptions } from '@/eslint/shared/env-utils.ts'\nimport { createConfig, customRules, convertRuleWarningsToErrors, mergeSettings } from '@/eslint/shared/env-utils.ts'\n\nimport jsxShorthandBoolean from '@/eslint/rules/react/jsxShorthandBoolean'\nimport preferDestructuringAssignment from '@/eslint/rules/react/preferDestructuringAssignment'\n\n// types ======================================================================\n\n/**\n * Configuration options for the environment preset 'env.react'.\n */\nexport interface EnvReactOptions extends EnvBaseOptions {\n\n /**\n * Configuration for the rule '@eslint-react/rules-of-hooks'.\n *\n * Additional hooks that will be treated as effect hooks, like 'useEffect'.\n */\n effectHooks?: readonly string[]\n\n /**\n * Configuration for the rule '@eslint-react/set-state-in-effect'.\n *\n * Additional hooks that will be treated as state hooks, like 'useState'.\n */\n stateHooks?: readonly string[]\n}\n\n// functions ==================================================================\n\n/**\n * Creates configuration objects with linter rules for ReactJS.\n *\n * Wraps the following packages:\n * - `@eslint-react/eslint-plugin`\n * - `eslint-plugin-react-hooks`\n * - `eslint-plugin-react-refresh`\n * - `eslint-plugin-jsx-a11y`\n *\n * @param envOptions\n * Configuration options for the environment.\n *\n * @returns\n * The configuration entries to be added to the resulting configuration array.\n */\nexport default function react(envOptions: EnvReactOptions): ConfigArg {\n\n const reactConfig = reactPlugin.configs['strict-type-checked']\n\n // extend shared plugin settings\n const settings = { ...reactConfig.settings }\n if (envOptions.effectHooks?.length) {\n const additionalEffectHooks = `/^(${envOptions.effectHooks.join('|')})$/`\n mergeSettings(settings, 'react-x', { additionalEffectHooks })\n }\n if (envOptions.stateHooks?.length) {\n const additionalStateHooks = `/^(${envOptions.stateHooks.join('|')})$/`\n mergeSettings(settings, 'react-x', { additionalStateHooks })\n }\n\n return [\n\n // configure 'react' plugin for all source files (JSX and TSX)\n createConfig('env.react.recommended', envOptions, {\n // auto-detect installed React version\n languageOptions: {\n parser,\n parserOptions: { projectService: true },\n },\n // register rule implementations and language settings, raise all recommended rules to 'error' level\n ...convertRuleWarningsToErrors(reactConfig),\n // additional settings\n settings,\n }, {\n // custom overrides\n '@eslint-react/dom-no-unknown-property': 'error',\n '@eslint-react/jsx-no-leaked-dollar': 'error',\n '@eslint-react/jsx-no-useless-fragment': ['error', { allowEmptyFragment: true }],\n '@eslint-react/naming-convention-context-name': 'error',\n '@eslint-react/no-missing-component-display-name': 'error',\n '@eslint-react/no-missing-context-display-name': 'error',\n }),\n\n createConfig('env.react.recommended', envOptions, {\n extends: [\n reactKit()\n .use(jsxShorthandBoolean)\n .use(preferDestructuringAssignment)\n .getConfig(),\n ],\n }),\n\n // 'react-hooks' plugin and recommended rules, raise all recommended rules to 'error' level\n createConfig('env.react.react-hooks', envOptions, convertRuleWarningsToErrors(reactHooksPlugin.configs.flat.recommended), {\n // disable rules that are also implemented in @eslint-react\n 'react-hooks/exhaustive-deps': 'off',\n 'react-hooks/rules-of-hooks': 'off',\n 'react-hooks/set-state-in-effect': 'off',\n 'react-hooks/set-state-in-render': 'off',\n }),\n\n // 'react-refresh' plugin\n createConfig('env.react.react-refresh', envOptions, reactRefresh.configs.vite()),\n\n // 'jsx-a11y' plugin\n createConfig('env.react.jsx-a11y', envOptions, jsxA11yPlugin.flatConfigs.recommended),\n\n // custom rules\n customRules('env.react.rules', envOptions),\n ]\n}\n","\nimport eslintPlugin from 'eslint-plugin-eslint-plugin'\n\nimport type { ConfigArg, EnvBaseOptions } from '@/eslint/shared/env-utils.ts'\nimport { createConfig, customRules } from '@/eslint/shared/env-utils.ts'\n\n// types ======================================================================\n\n/**\n * Configuration options for the environment preset 'env.eslint'.\n */\nexport interface EnvEslintOptions extends EnvBaseOptions { }\n\n// exports ====================================================================\n\n/**\n * Adds linter rules for ESLint plugin implementations.\n *\n * Wraps the following packages:\n * - `eslint-plugin-eslint-plugin`\n *\n * @param envOptions\n * Configuration options for the environment.\n *\n * @returns\n * The configuration entries to be added to the resulting configuration array.\n */\nexport default function eslint(envOptions: EnvEslintOptions): ConfigArg {\n\n return [\n\n // register rule implementations and recommended rules\n createConfig('env.eslint.recommended', envOptions, eslintPlugin.configs['rules-recommended']),\n\n // custom rules\n customRules('env.eslint.rules', envOptions, {\n 'eslint-plugin/no-property-in-node': 'error',\n 'eslint-plugin/prefer-placeholders': 'error',\n 'eslint-plugin/prefer-replace-text': 'error',\n 'eslint-plugin/require-meta-docs-description': 'error',\n }),\n ]\n}\n","\nimport { AST_NODE_TYPES as NodeType, ESLintUtils } from '@typescript-eslint/utils'\n\nimport type { ImportExportNode } from '@/eslint/shared/rule-utils.ts'\nimport { Schema, ProjectContext } from '@/eslint/shared/rule-utils.ts'\n\n// types ======================================================================\n\n/**\n * Configuration for the rule 'env-project/no-invalid-modules'.\n */\nexport interface RuleNoInvalidModulesOptions {\n\n /**\n * Specifies glob patterns for external modules.\n */\n external?: string[]\n}\n\n// ----------------------------------------------------------------------------\n\ntype RuleOptions = [Required<RuleNoInvalidModulesOptions>]\ntype RuleMessageIds = 'SOURCE_FILE_NOT_FOUND'\n\n// exports ====================================================================\n\nexport default ESLintUtils.RuleCreator.withoutDocs<RuleOptions, RuleMessageIds>({\n\n meta: {\n type: 'problem',\n schema: [\n // single options object\n Schema.options({\n external: Schema.array(Schema.stringNE()),\n }),\n ],\n messages: {\n SOURCE_FILE_NOT_FOUND: 'Source file for `{{moduleName}}` not found.',\n },\n fixable: 'code',\n },\n\n defaultOptions: [{\n external: [],\n }],\n\n create(context, [options]) {\n\n // create the project context with aliases, root path, own module name, etc.\n const projectContext = new ProjectContext(context)\n\n return {\n 'ImportDeclaration, TSExternalModuleReference, ImportExpression, ExportAllDeclaration, ExportNamedDeclaration'(node: ImportExportNode) {\n\n // import/export statement must contain string literal\n const importWrapper = projectContext.resolveImportNode(node)\n if (!importWrapper) return\n\n // skip glob patterns in TypeScript type imports\n if ((node.type === NodeType.ImportDeclaration) && (node.importKind === 'type') && importWrapper.moduleName.includes('*')) {\n return\n }\n\n // accept known external module\n if (importWrapper.matchModuleName(options.external)) return\n\n // extract alias key, replace with alias path\n const [aliasKey, modulePath] = projectContext.resolveAlias(importWrapper.moduleName)\n\n // accept installed npm package\n if (!aliasKey && projectContext.packageExists(modulePath)) return\n\n // check existence of source file\n if (!projectContext.fileExists(modulePath)) {\n context.report({\n messageId: 'SOURCE_FILE_NOT_FOUND',\n node: importWrapper.sourceNode,\n data: { moduleName: importWrapper.moduleName },\n })\n }\n },\n }\n },\n})\n","\nimport { AST_NODE_TYPES as NodeType, ESLintUtils } from '@typescript-eslint/utils'\n\nimport type { ImportExportNode } from '@/eslint/shared/rule-utils.ts'\nimport { Schema, makeArray, ProjectContext } from '@/eslint/shared/rule-utils.ts'\n\n// types ======================================================================\n\n/**\n * Configuration for the rule 'env-project/no-invalid-hierarchy' to specify a\n * sub package inside a project.\n */\nexport interface RuleNoInvalidHierarchyPackage {\n\n /**\n * Glob patterns selecting all source files that are part of the package.\n */\n files: string[]\n\n /**\n * Specifies the names of all packages (keys of the `packages` dictionary)\n * this package depends on.\n */\n extends?: string | string[]\n\n /**\n * Set to `true` to mark an optional package that may be missing in an\n * installation. Such a package cannot be imported statically (with `import`\n * statement) from a non-optional package, but can only be loaded dynamically\n * at runtime (by calling `import()`). The rule will mark all static imports\n * of optional code as an error.\n *\n * @default false\n */\n optional?: boolean\n}\n\n// ----------------------------------------------------------------------------\n\nexport type RuleNoInvalidHierarchyOptions = Record<string, RuleNoInvalidHierarchyPackage>\n\n// ----------------------------------------------------------------------------\n\ntype RuleOptions = [RuleNoInvalidHierarchyOptions]\ntype RuleMessageIds = 'UNEXPECTED_OPTIONAL_STATIC' | 'INVALID_PACKAGE_HIERARCHY'\n\n// exports ====================================================================\n\nexport default ESLintUtils.RuleCreator.withoutDocs<RuleOptions, RuleMessageIds>({\n\n meta: {\n type: 'problem',\n schema: [\n // single options object\n Schema.dictionary(Schema.options({\n files: Schema.maybeArray(Schema.stringNE()),\n extends: Schema.maybeArray(Schema.stringNE()),\n optional: Schema.boolean(),\n }, ['files'])),\n ],\n messages: {\n UNEXPECTED_OPTIONAL_STATIC: 'Unexpected static import of optional package.',\n INVALID_PACKAGE_HIERARCHY: 'Low-level package cannot import modules from higher-level package.',\n },\n fixable: 'code',\n },\n\n defaultOptions: [{}],\n\n create(context, [options]) {\n\n // create the project context with aliases, root path, own module name, etc.\n const projectContext = new ProjectContext(context)\n\n /** @ignore */\n interface Package extends RuleNoInvalidHierarchyPackage {\n extends: string[]\n }\n\n // convert strings in record entries to arrays\n const hierarchyMap = new Map<string, Package>()\n for (const [key, settings] of Object.entries(options)) {\n hierarchyMap.set(key, {\n ...settings,\n extends: makeArray(settings.extends),\n })\n }\n\n // collect all globs for package members\n const packagesGlobs = Array.from(hierarchyMap.values(), settings => settings.files).flat()\n\n return {\n 'ImportDeclaration, TSExternalModuleReference, ImportExpression, ExportAllDeclaration, ExportNamedDeclaration'(node: ImportExportNode) {\n\n // import/export statement must contain string literal\n const importWrapper = projectContext.resolveImportNode(node)\n if (!importWrapper) return\n\n // check dependencies if the imported module is covered in the configuration\n if (!importWrapper.matchModuleName(packagesGlobs)) return\n\n // whether an invalid static import has been found ('as boolean' to workaround linter)\n let invalidStatic = false as boolean\n\n // recursively checks the imported module for dependency violations\n const checkDependencies = (settings: Package, root: boolean): boolean => {\n\n // only allow static imports from specified package, if it is not optional\n if (importWrapper.matchModuleName(settings.files)) {\n if (!root && (node.type !== NodeType.ImportExpression) && settings.optional) invalidStatic = true\n return true\n }\n\n // do not traverse into dependencies of optional modules\n if (!settings.extends.length || (!root && settings.optional)) {\n return false\n }\n\n // allow imports from any of the dependent packages\n return settings.extends.some(key => {\n const package2 = hierarchyMap.get(key)\n return !!package2 && checkDependencies(package2, false)\n })\n }\n\n // check dependencies of all configured packages (not for anonymous modules)\n let invalidDeps = false\n for (const settings of hierarchyMap.values()) {\n if (projectContext.matchModuleName(settings.files) && !checkDependencies(settings, true)) {\n invalidDeps = true\n break\n }\n }\n\n // report package hierarchy errors\n if (invalidStatic) {\n context.report({ messageId: 'UNEXPECTED_OPTIONAL_STATIC', node: importWrapper.sourceNode })\n } else if (invalidDeps) {\n context.report({ messageId: 'INVALID_PACKAGE_HIERARCHY', node: importWrapper.sourceNode })\n }\n },\n }\n },\n})\n","\nimport type { ConfigArg, EnvBaseOptions } from '@/eslint/shared/env-utils.ts'\nimport { createConfig, customRules } from '@/eslint/shared/env-utils.ts'\nimport type { SharedRuleSettings } from '@/eslint/shared/rule-utils.ts'\n\nimport noInvalidModules, { type RuleNoInvalidModulesOptions } from '@/eslint/rules/project/noInvalidModules.ts'\nimport noInvalidHierarchy, { type RuleNoInvalidHierarchyOptions } from '@/eslint/rules/project/noInvalidHierarchy.ts'\n\n// types ======================================================================\n\n/**\n * Configuration options for the environment preset 'env.project'.\n */\nexport interface EnvProjectOptions extends EnvBaseOptions {\n\n /**\n * Maps all alias prefixes to actual paths in the project.\n */\n alias?: SharedRuleSettings['alias']\n\n /**\n * Options to be passed to the rule 'env-project/no-invalid-modules'.\n */\n external?: RuleNoInvalidModulesOptions['external']\n\n /**\n * Options to be passed to the rule 'env-project/no-invalid-hierarchy'.\n */\n hierarchy?: RuleNoInvalidHierarchyOptions\n}\n\n// exports ====================================================================\n\n/**\n * Adds custom linter rules for checking project setup and module hierarchy.\n *\n * @param envOptions\n * Configuration options for the environment.\n *\n * @returns\n * The configuration entries to be added to the resulting configuration array.\n */\nexport default function project(envOptions: EnvProjectOptions): ConfigArg {\n\n return [\n\n // register rule implementations\n createConfig('env.project.plugin', envOptions, {\n plugins: {\n 'env-project': {\n rules: {\n 'no-invalid-modules': noInvalidModules,\n 'no-invalid-hierarchy': noInvalidHierarchy,\n },\n },\n },\n settings: {\n 'env-project': {\n alias: envOptions.alias,\n },\n },\n }),\n\n // custom rules\n customRules('env.project.rules', envOptions, {\n 'env-project/no-invalid-modules': ['error', { external: envOptions.external ?? [] }],\n 'env-project/no-invalid-hierarchy': envOptions.hierarchy ? ['error', envOptions.hierarchy] : 'off',\n }),\n ]\n}\n","\nimport type { ConfigArg, EnvBaseOptions } from '@/eslint/shared/env-utils.ts'\nimport { createConfig, customRules } from '@/eslint/shared/env-utils.ts'\n\n// types ======================================================================\n\n/**\n * Configuration options for the environment preset 'env.tsconfig'.\n */\nexport interface EnvTSConfigOptions extends EnvBaseOptions {\n\n /**\n * The path to the TypeScript project configuration file (`tsconfig.json`).\n */\n project: string\n}\n\n// functions ==================================================================\n\n/**\n * Creates configuration objects for TypeScript projects.\n *\n * @param envOptions\n * Configuration options for the environment.\n *\n * @returns\n * The configuration entries to be added to the resulting configuration array.\n */\nexport default function tsconfig(envOptions: EnvTSConfigOptions): ConfigArg {\n\n return [\n\n // path to project configuration file\n createConfig('env.tsconfig.project', envOptions, {\n languageOptions: {\n parserOptions: {\n projectService: false,\n project: envOptions.project,\n },\n },\n }),\n\n // custom rules\n customRules('env.tsconfig.rules', envOptions),\n ]\n}\n","\nimport * as babelParser from '@babel/eslint-parser'\n\nimport type { ConfigArg, EnvBaseOptions } from '@/eslint/shared/env-utils.ts'\nimport { TS_GLOB, createConfig, customRules } from '@/eslint/shared/env-utils.ts'\n\n// types ======================================================================\n\n/**\n * Configuration options for the environment preset 'env.decorators'.\n */\nexport interface EnvDecoratorsOptions extends EnvBaseOptions { }\n\n// functions ==================================================================\n\n/**\n * Adds support for native decorators in JavaScript source files.\n *\n * Wraps the following packages:\n * - `@babel/eslint-parser`\n * - `@babel/plugin-proposal-decorators`\n *\n * @param envOptions\n * Configuration options for the environment.\n *\n * @returns\n * The configuration entries to be added to the resulting configuration array.\n */\nexport default function decorators(envOptions: EnvBaseOptions): ConfigArg {\n\n return [\n\n createConfig('core.decorators.babel', envOptions, {\n ignores: TS_GLOB,\n languageOptions: {\n parser: babelParser,\n parserOptions: {\n requireConfigFile: false,\n babelOptions: {\n babelrc: false,\n configFile: false,\n parserOpts: { plugins: ['decorators'] },\n },\n },\n },\n }),\n\n customRules('core.decorators.rules', envOptions),\n ]\n}\n","\nimport type { ConfigObject, RulesConfig } from '@eslint/core'\nimport { defineConfig as defineEslintConfig, globalIgnores } from '@eslint/config-helpers'\n\nimport { flattenDeepArrays } from '@/utils/utils.ts'\nimport { PathResolver } from '@/utils/resolver.ts'\nimport type { Config, ConfigArg, LanguageOptions, LanguageConfig, PackagesOptions, PackagesConfig, StylisticOptions, StylisticConfig } from '@/eslint/shared/env-utils.ts'\nimport type { VueOptions } from '@/eslint/core/vue.ts'\n\nimport base from '@/eslint/core/base.ts'\nimport js from '@/eslint/core/js.ts'\nimport ts from '@/eslint/core/ts.ts'\nimport vue from '@/eslint/core/vue.ts'\nimport json from '@/eslint/core/json.ts'\nimport yaml from '@/eslint/core/yaml.ts'\nimport markdown from '@/eslint/core/markdown.ts'\nimport license from '@/eslint/core/license.ts'\nimport directives from '@/eslint/core/directives.ts'\nimport packages from '@/eslint/core/packages.ts'\nimport regexp from '@/eslint/core/regexp.ts'\nimport promises from '@/eslint/core/promises.ts'\nimport jsdoc from '@/eslint/core/jsdoc.ts'\nimport stylistic from '@/eslint/core/stylistic.ts'\n\nimport node from '@/eslint/env/node.ts'\nimport browser from '@/eslint/env/browser.ts'\nimport jest from '@/eslint/env/jest.ts'\nimport vitest from '@/eslint/env/vitest.ts'\nimport codecept from '@/eslint/env/codecept.ts'\nimport react from '@/eslint/env/react.ts'\nimport eslint from '@/eslint/env/eslint.ts'\nimport project from '@/eslint/env/project.ts'\nimport tsconfig from '@/eslint/env/tsconfig.ts'\nimport decorators from '@/eslint/env/decorators.ts'\n\n// types ======================================================================\n\nexport type { ConfigObject, LanguageOptions, PackagesOptions, RulesConfig, StylisticOptions, VueOptions }\n\n/**\n * Configuration options for linting the entire project with ESLint.\n */\nexport interface ProjectOptions {\n\n /**\n * The URL of the project root containing the ESLint configuration file.\n * Should usually be set to `import.meta.url`.\n */\n root: string\n\n /**\n * Glob patterns with all files and folders to be ignored by ESLint.\n */\n ignores?: readonly string[]\n\n /**\n * Path to the template file containing the license header to be used in all\n * source files. May be a path relative to the project root.\n */\n license?: string\n\n /**\n * Configuration options for language and project setup.\n */\n language?: LanguageOptions\n\n /**\n * Configuration options for external package dependencies.\n */\n packages?: PackagesOptions\n\n /**\n * Configuration options for code style.\n */\n stylistic?: StylisticOptions\n\n /**\n * Additional configuration options for Vue source files.\n */\n vue?: VueOptions\n\n /**\n * Additional linter rules to be added to the global configuration.\n */\n rules?: RulesConfig\n}\n\n// environment presets ========================================================\n\n/**\n * A collection with all available environment presets.\n */\nexport const env = {\n node,\n browser,\n jest,\n vitest,\n codecept,\n react,\n eslint,\n project,\n tsconfig,\n decorators,\n} as const\n\n// functions ==================================================================\n\n/**\n * Generates a complete ESLint configuration array.\n *\n * @param options\n * Options for the base configuration that will be generated.\n *\n * @param configs\n * Additional configuration entries: Each parameter may be a callback function\n * that will be invoked with a `PathResolver` utility.\n *\n * @returns\n * The resulting ESLint configuration array that must be returned from the\n * `eslint.config.*` file.\n */\nexport function defineConfig(options: ProjectOptions, ...configs: Array<ConfigArg | ((resolver: PathResolver) => ConfigArg)>): ConfigObject[] {\n\n const ignores: string[] = [\n '*/.yarn',\n 'dist',\n 'output',\n 'vite.config.ts.*.mjs',\n 'gitlab-ci',\n '.gitlab-ci.yml',\n 'coverage', // Vitest\n '.nuxt', // NuxtJS\n '.output', // NuxtJS\n ...(options.ignores ?? []),\n ]\n\n // resolve language configuration options\n const languageConfig: LanguageConfig = {\n ecmaVersion: 'latest',\n sourceType: 'module',\n ...options.language,\n }\n\n // resolve dependency configuration options\n const packagesConfig: PackagesConfig = {\n allowed: [],\n banned: [],\n ...options.packages,\n }\n\n // resolve stylistic configuration options\n const indent = options.stylistic?.indent ?? 2\n const stylisticConfig: StylisticConfig = {\n semi: 'never',\n quotes: 'single',\n dangle: 'always',\n funcSpacing: 'off',\n ...options.stylistic,\n indent,\n indentOverrides: {\n js: indent,\n json: indent,\n yaml: indent,\n vue: indent,\n ...options.stylistic?.indentOverrides,\n },\n }\n\n // the resolver for relative file paths\n const resolver = new PathResolver(options.root)\n\n return defineEslintConfig(flattenDeepArrays<Config>(\n\n // ignore certain files and folders\n globalIgnores(ignores, 'index:global-ignores'),\n\n // module types and standard rules for all JS/TS source files\n base(languageConfig),\n\n // default configuration for JavaScript files\n js(),\n\n // default configuration for TypeScript files\n ts(resolver.root),\n\n // default configuration for Vue.js files\n vue(resolver.root, stylisticConfig, options.vue),\n\n // default configuration for JSON files\n json(stylisticConfig),\n\n // default configuration for YAML files\n yaml(stylisticConfig),\n\n // default configuration for Markdown files\n markdown(),\n\n // check for correct license headers\n options.license ? license(resolver.path(options.license)) : undefined,\n\n // default configuration for ESLint inline directives\n directives(),\n\n // default configuration for outdated dependencies\n packages(packagesConfig),\n\n // default configuration for regular expressions\n regexp(),\n\n // default configuration for native promises\n promises(),\n\n // default configuration for JSDoc\n jsdoc(),\n\n // default configuration for code style checks\n stylistic(stylisticConfig),\n\n // custom rules\n options.rules && { name: 'core.index.custom-rules', rules: options.rules },\n\n // custom configuration entries\n configs.map(config => (typeof config === 'function') ? config(resolver) : config),\n ) as ConfigObject[])\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,UAAiB,gBAAmB,GAAG,QAAqD;CAC1F,KAAK,MAAM,WAAW,QACpB,IAAI,MAAM,QAAQ,OAAO,GACvB,OAAO,gBAAgB,GAAG,OAAO;MAC5B,IAAI,SACT,MAAM;AAGZ;;;;;;;;;;;;;AAcA,SAAgB,kBAAqB,GAAG,QAAqC;CAC3E,OAAO,CAAC,GAAG,gBAAgB,GAAG,MAAM,CAAC;AACvC;;;;;;ACoLA,MAAa,gBAAgB;CAAC;CAAM;CAAO;CAAO;AAAK;;;;AAKvD,MAAa,gBAAgB;CAAC;CAAM;CAAO;CAAO;AAAK;;;;AAKvD,MAAa,iBAAiB,CAAC,GAAG,eAAe,GAAG,aAAa;;;;AAKjE,MAAa,UAAU,QAAQ,aAAa;;;;AAK5C,MAAa,UAAU,QAAQ,aAAa;;;;AAK5C,MAAa,WAAW,QAAQ,cAAc,KAAI,QAAO,OAAO,GAAG,CAAC;;;;AAKpE,MAAa,WAAW,QAAQ,cAAc;;;;AAK9C,MAAa,WAAW,QAAQ,CAAC,KAAK,CAAC;;;;;AAMvC,MAAa,yBAAyB;CACpC,mBAAmB;CACnB,mBAAmB;CACnB,gCAAgC;CAChC,cAAc;CACd,oBAAoB;AACtB;;;;;AAMA,MAAa,+BAA+B;CAC1C,2BAA2B;CAC3B,OAAO,CAAC,IAAI;AACd;;;;;;;;;;;AAcA,SAA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GP,SAAS,GAGTC,QAAM,GAGN,UAAU,eAAe,GAGzB,QAAQ,SAAS;EAAE,MAAM;EAA2B,OAAO,QAAQ;CAAM,GAGzE,QAAQ,KAAI,WAAW,OAAO,WAAW,aAAc,OAAO,QAAQ,IAAI,MAAM,CAClF,CAAmB;AACrB"}
1
+ {"version":3,"file":"index.mjs","names":["pluginConfigs","jsdoc","jsdocPlugin","NodeType","#aliasMap","#rootDir","#configPath","#moduleName","#requireModule","NodeType","NodeType","NodeType","noInvalidModules","noInvalidHierarchy","defineEslintConfig","jsdoc"],"sources":["../../src/utils/utils.ts","../../src/eslint/shared/env-utils.ts","../../src/eslint/shared/restricted.ts","../../src/eslint/core/base.ts","../../src/eslint/core/js.ts","../../src/eslint/core/ts.ts","../../src/eslint/core/vue.ts","../../src/eslint/core/json.ts","../../src/eslint/core/yaml.ts","../../src/eslint/core/markdown.ts","../../src/eslint/core/license.ts","../../src/eslint/core/directives.ts","../../src/eslint/core/packages.ts","../../src/eslint/core/regexp.ts","../../src/eslint/core/promises.ts","../../src/eslint/core/jsdoc.ts","../../src/eslint/core/stylistic.ts","../../src/eslint/env/node.ts","../../src/eslint/env/browser.ts","../../src/eslint/shared/unittest.ts","../../src/eslint/env/jest.ts","../../src/eslint/env/vitest.ts","../../src/eslint/env/codecept.ts","../../src/eslint/shared/rule-utils.ts","../../src/eslint/rules/react/jsxShorthandBoolean.ts","../../src/eslint/rules/react/preferDestructuringAssignment.ts","../../src/eslint/env/react.ts","../../src/eslint/env/eslint.ts","../../src/eslint/rules/project/noInvalidModules.ts","../../src/eslint/rules/project/noInvalidHierarchy.ts","../../src/eslint/env/project.ts","../../src/eslint/env/tsconfig.ts","../../src/eslint/env/decorators.ts","../../src/eslint/index.ts"],"sourcesContent":["\n// types ======================================================================\n\nexport type DeepRequired<T> = {\n [key in keyof T]-?: DeepRequired<T[key]>\n}\n\nexport type DeepOptArray<T> = T | false | null | undefined | ReadonlyArray<DeepOptArray<T>>\n\n// functions ==================================================================\n\n/**\n * Creates an iterator that visits all truthy elements of all deeply nested\n * arrays.\n *\n * @template T\n * The element type of the array.\n *\n * @param arrays\n * The deeply nested arrays to be visited.\n *\n * @yields\n * The truthy array elements.\n */\nexport function *yieldDeepArrays<T>(...arrays: Array<DeepOptArray<T>>): IterableIterator<T> {\n for (const element of arrays) {\n if (Array.isArray(element)) {\n yield* yieldDeepArrays(...element)\n } else if (element) {\n yield element as T\n }\n }\n}\n\n/**\n * Returns a flat array with all truthy elements of all deeply nested arrays.\n *\n * @template T\n * The element type of the array.\n *\n * @param arrays\n * The deeply nested arrays to be flattened.\n *\n * @returns\n * The flattened array elements.\n */\nexport function flattenDeepArrays<T>(...arrays: Array<DeepOptArray<T>>): T[] {\n return [...yieldDeepArrays(...arrays)]\n}\n","\nimport type { Linter } from 'eslint'\nimport type { RuleConfig, RulesConfig, ConfigObject } from '@eslint/core'\nimport type { ConfigWithExtends } from '@eslint/config-helpers'\nimport type { TSESLint } from '@typescript-eslint/utils'\n\nimport type { DeepRequired, DeepOptArray } from '@/utils/utils.ts'\nimport { flattenDeepArrays } from '@/utils/utils.ts'\n\n// types ======================================================================\n\n// TODO: investigate: `Config` from '@eslint/config-helpers' is incompatible with `Linter.Config` and `TSESLint.FlatConfig.Config`\nexport type Config = ConfigObject | ConfigWithExtends | Linter.Config | TSESLint.FlatConfig.Config\n\nexport type ConfigArg = DeepOptArray<Config>\n\n// ----------------------------------------------------------------------------\n\n/**\n * Configuration options for language and project setup.\n */\nexport interface LanguageOptions {\n\n /**\n * The ECMAScript version to be used in the project (version or year).\n *\n * @default 'latest'\n */\n ecmaVersion?: Linter.EcmaVersion\n\n /**\n * Specifies how to treat `.js`, `.jsx`, `.ts`, and `.tsx` files.\n *\n * - 'module': The files will be considered being ES modules.\n * - 'commonjs': The files will be considered being CommonJS modules.\n *\n * @default 'module'\n */\n sourceType?: 'module' | 'commonjs'\n}\n\n/**\n * Required configuration options for language and project setup.\n */\nexport type LanguageConfig = DeepRequired<LanguageOptions>\n\n// ----------------------------------------------------------------------------\n\n/**\n * Configuration options for external package dependencies.\n */\nexport interface PackagesOptions {\n\n /**\n * A list of packages to be allowed in the project even if they have been\n * banned by the plugin `eslint-plugin-depend`.\n */\n allowed?: readonly string[]\n\n /**\n * A list of additional packages to be banned in the project.\n */\n banned?: readonly string[]\n}\n\n/**\n * Required configuration options for external package dependencies.\n */\nexport type PackagesConfig = DeepRequired<PackagesOptions>\n\n// ----------------------------------------------------------------------------\n\n/**\n * Configuration options for code indentation per file type.\n */\nexport interface IndentOverridesOptions {\n\n /**\n * Indentation size for JavaScript and TypeScript files, including JSX.\n */\n js?: number\n\n /**\n * Indentation size for JSON files.\n */\n json?: number\n\n /**\n * Indentation size for YAML files.\n */\n yaml?: number\n\n /**\n * Indentation size for Vue.js files (script and template blocks).\n */\n vue?: number\n}\n\n/**\n * Configuration options for code style.\n */\nexport interface StylisticOptions {\n\n /**\n * Default indentation (number of space characters) for all file types.\n *\n * Affects rules `@stylistic/indent`, `@stylistic/indent-binary-ops`,\n * `@stylistic/jsx-indent-props`, `vue/html-indent`, `jsonc/indent`, and\n * `yml/indent`.\n *\n * @default 2\n */\n indent?: number\n\n /**\n * Indentation (number of space characters) overrides for specific file\n * types.\n *\n * @default 2\n */\n indentOverrides?: IndentOverridesOptions\n\n /**\n * Specifies how to treat semicolons.\n *\n * - 'always': Require semicolons following all statements.\n * - 'never': Require to omit semicolons according to ASI rules.\n * - 'off': Semicolons will not be checked.\n *\n * Affects rules `@stylistic/semi` and `@stylistic/member-delimiter-style`.\n *\n * @default 'never'\n */\n semi?: 'always' | 'never' | 'off'\n\n /**\n * The type of the string delimiter character.\n *\n * Affects rule `@stylistic/string-quotes`.\n *\n * @default 'single'\n */\n quotes?: 'single' | 'double' | 'off'\n\n /**\n * Specifies how to treat dangling commas in multiline lists.\n *\n * - 'always': Dangling commas will be required in all multi-line array\n * literals, object literals, function parameters, template parameters,\n * imports, and exports.\n * - 'never': Dangling commas will be forbidden.\n * - 'off': Dangling commas will not be checked.\n *\n * Affects rules `@stylistic/comma-dangle` and `vue/comma-dangle`.\n *\n * @default 'always'\n */\n dangle?: 'always' | 'never' | 'off'\n\n /**\n * Specifies whether to expect whitespace between function names and\n * parentheses. Does not affect anonymous functions and `catch` clauses.\n *\n * Affects rule `@stylistic/space-before-function-paren`.\n *\n * - 'always': Spacing between function name and parenthesis required.\n * - 'never': Spacing between function name and parenthesis forbidden.\n * - 'off': Spacing between function name and parenthesis will be ignored.\n *\n * @default 'off'\n */\n funcSpacing?: 'always' | 'never' | 'off'\n}\n\n/**\n * Required configuration options for code style.\n */\nexport type StylisticConfig = DeepRequired<StylisticOptions>\n\n// ----------------------------------------------------------------------------\n\n/**\n * Shared options for an environment preset with included and excluded files.\n */\nexport interface EnvFilesOptions {\n\n /**\n * Path to a sub directory to apply the environment preset to. The options\n * 'files' and 'ignores' will be interpreted relatively to this path.\n *\n * @default '.'\n */\n basePath?: string\n\n /**\n * Glob patterns for source files to be included into the environment. A file\n * will be included if it matches one of the patterns. Inner arrays can be\n * used to express AND conditions for files.\n */\n files: ReadonlyArray<string | string[]>\n\n /**\n * Glob patterns for source files matching `files` to be ignored.\n *\n * @default []\n */\n ignores?: readonly string[]\n}\n\n// ----------------------------------------------------------------------------\n\n/**\n * Shared options for an environment preset: include and exclude files, and add\n * more linter rules.\n */\nexport interface EnvBaseOptions extends EnvFilesOptions {\n\n /**\n * Additional linter rules to be added to the configuration.\n */\n rules?: RulesConfig\n}\n\n// constants ==================================================================\n\n/**\n * File extensions for JavaScript source files.\n */\nexport const JS_EXTENSIONS = ['js', 'jsx', 'mjs', 'cjs']\n\n/**\n * File extensions for TypeScript source files.\n */\nexport const TS_EXTENSIONS = ['ts', 'tsx', 'mts', 'cts']\n\n/**\n * File extensions for all source files (JavaScript and TypeScript).\n */\nexport const SRC_EXTENSIONS = [...JS_EXTENSIONS, ...TS_EXTENSIONS]\n\n/**\n * Glob array for JavaScript source files (including 'jsx').\n */\nexport const JS_GLOB = extGlob(JS_EXTENSIONS)\n\n/**\n * Glob array for TypeScript source files (including 'tsx').\n */\nexport const TS_GLOB = extGlob(TS_EXTENSIONS)\n\n/**\n * Glob array for TypeScript type declaration files.\n */\nexport const DTS_GLOB = extGlob(TS_EXTENSIONS.map(ext => 'd.' + ext))\n\n/**\n * Glob array for all source files (JavaScript and TypeScript).\n */\nexport const SRC_GLOB = extGlob(SRC_EXTENSIONS)\n\n/**\n * Glob array for all VueJS SFC files.\n */\nexport const VUE_GLOB = extGlob(['vue'])\n\n/**\n * Shared options for the core rule `no-unused-vars`, and the plugin rule\n * `@typescript-eslint/no-unused-vars`.\n */\nexport const NO_UNUSED_VARS_OPTIONS = {\n varsIgnorePattern: '^_.',\n argsIgnorePattern: '^_.',\n destructuredArrayIgnorePattern: '^_.',\n caughtErrors: 'all',\n ignoreRestSiblings: true,\n}\n\n/**\n * Shared options for the core rule `no-implicit-coercion`, and all related\n * plugin rules (e.g. from the Vue plugin).\n */\nexport const NO_IMPLICIT_COERCION_OPTIONS = {\n disallowTemplateShorthand: true,\n allow: ['!!'] as ['!!'], // workaround for overly strict typings of 'eslint-plugin-vue'\n}\n\n// functions ==================================================================\n\n/**\n * Creates a glob pattern deeply matching all files with the specified file\n * extensions.\n *\n * @param extensions\n * The file extensions to be converted to a glob pattern.\n *\n * @returns\n * The glob pattern for the specified file extensions.\n */\nexport function extGlob(extensions: string[]): string[] {\n return extensions.map(ext => '**/*.' + ext)\n}\n\n/**\n * Creates a configuration entry with 'files' and 'ignores' settings from an\n * environment's 'envOptions' object.\n *\n * @param name\n * The name of the configuration entry.\n *\n * @param envOptions\n * The environment options containing 'files' and 'ignores' settings.\n *\n * @param config\n * Properties for the configuration entry to be built. Additional 'files' and\n * 'ignores' properties will be merged with the settings from 'envOptions'.\n *\n * @param rules\n * Hard-coded rule settings to be added to the configuration.\n *\n * @returns\n * The resulting configuration entry.\n */\nexport function createConfig(name: string, envOptions: EnvFilesOptions, config: Config, rules?: RulesConfig): Config {\n const basePath = envOptions.basePath ?? config.basePath\n return {\n ...config,\n name,\n ...(basePath ? { basePath } : undefined),\n files: [envOptions.files, config.files].filter(e => !!e).flat(1),\n ignores: [envOptions.ignores, config.ignores].filter(e => !!e).flat(1),\n rules: { ...config.rules, ...rules },\n }\n}\n\n/**\n * Creates a configuration entry with 'files', 'ignores', and 'rules' settings\n * from an environment's 'envOptions' object.\n *\n * @param name\n * The name of the configuration entry.\n *\n * @param envOptions\n * The environment options containing 'files', 'ignores', and 'rules'\n * settings.\n *\n * @param rules\n * Hard-coded rule settings to be configured by the environment itself. These\n * rule settings will precede the rules contained in 'envOptions', in order to\n * allow to override them.\n *\n * @returns\n * The resulting configuration entry, if the environment options contain\n * custom rule settings, otherwise `undefined`.\n */\nexport function customRules(name: string, envOptions: EnvBaseOptions, rules?: RulesConfig): Config | undefined {\n return (rules ?? envOptions.rules) && createConfig(name, envOptions, {\n rules: { ...rules, ...envOptions.rules },\n })\n}\n\n/**\n * Finds the first configuration object with a 'files' property, and copies\n * this property into all other configurations objects with language options or\n * rules but lacking the 'files' property.\n *\n * @param configs\n * The configuration objects to be fixed.\n *\n * @returns\n * The fixed configuration options.\n */\nexport function fixMissingFilesOption(...configs: ConfigArg[]): Config[] {\n const flatConfigs = flattenDeepArrays(configs)\n const files = flatConfigs.find(config => !!config.files)?.files\n return files ? flatConfigs.map(config => (!config.files && (config.languageOptions || config.rules)) ? { ...config, files } : config) : flatConfigs\n}\n\n/**\n * Converts severity 'warning' of all rules in the passed configuration entry\n * to severity 'error'.\n *\n * @template T\n * The exact type of the passed configuration.\n *\n * @param config\n * The configuration entry to be converted.\n *\n * @returns\n * The converted configuration entry.\n */\nexport function convertRuleWarningsToErrors<T extends { rules?: Partial<RulesConfig> }>(config: T): T {\n return config.rules ? {\n ...config,\n rules: Object.fromEntries(Object.entries(config.rules).map(([key, value]) => {\n if (value === 'warn') {\n value = 'error'\n } else if (Array.isArray(value) && (value[0] === 'warn')) {\n value = ['error', ...value.slice(1)]\n }\n return [key, value]\n })),\n } : config\n}\n\n/**\n * Merges settings for a specific plugin in-place into a complete settings\n * object.\n *\n * @param settings\n * The settings object to be extended.\n *\n * @param plugin\n * The name of the plugin whose settings will be extended (top-level property\n * name in `settings`). Missing entries will be created on demand.\n *\n * @param props\n * The settings properties to me merged into the plugin settings.\n *\n * @returns\n * The extended settings object.\n */\nexport function mergeSettings(settings: Record<string, unknown>, plugin: string, props: Record<string, unknown>): Record<string, unknown> {\n const pluginSettings = settings[plugin] ??= {}\n Object.assign(pluginSettings, props)\n return settings\n}\n\n/**\n * Translates the stylistic option `dangle` to the configuration options for\n * 'comma-dangle' rules.\n *\n * @param stylisticConfig\n * Resolved stylistic configuration options.\n *\n * @returns\n * The configuration options for 'comma-dangle' rules.\n */\nexport function getCommaDangleConfig(stylisticConfig: StylisticConfig): RuleConfig<['never' | 'always' | 'always-multiline']> {\n const { dangle } = stylisticConfig\n return (dangle === 'always') ? ['error', 'always-multiline'] : (dangle === 'never') ? ['error', 'never'] : 'off'\n}\n","\nimport type { RulesConfig } from '@eslint/core'\n\nimport { flattenDeepArrays } from '@/utils/utils.ts'\nimport type { ConfigArg, EnvFilesOptions, EnvBaseOptions } from '@/eslint/shared/env-utils.ts'\nimport { createConfig } from '@/eslint/shared/env-utils.ts'\n\n// types ======================================================================\n\n/**\n * Configuration for a single banned global or import.\n */\nexport interface EnvRestrictedName {\n name: string\n message: string\n}\n\n/**\n * Configuration for a single banned object property.\n */\nexport interface EnvRestrictedProperty {\n object: string\n property: string\n message: string\n}\n\n/**\n * Configuration for a single banned syntax construct.\n */\nexport interface EnvRestrictedSyntax {\n selector: string\n message: string\n}\n\n/**\n * Collection of banned globals, imports, properties, and syntax constructs.\n */\nexport interface EnvRestrictedItems {\n /** The global symbols to be banned. */\n globals?: EnvRestrictedName[]\n /** The module imports to be banned. */\n imports?: EnvRestrictedName[]\n /** The global object properties to be banned. */\n properties?: EnvRestrictedProperty[]\n /** The syntax constructs to be banned. */\n syntax?: EnvRestrictedSyntax[]\n}\n\n/**\n * Collection of banned globals, imports, properties, and syntax constructs,\n * for a specific subset of the files included in an environment.\n */\nexport interface EnvRestrictedOverride extends EnvFilesOptions, EnvRestrictedItems { }\n\n/**\n * Type shape of a dedicated environment option 'restricted' with settings for\n * banned globals, imports, properties, and syntax constructs.\n */\nexport interface EnvRestrictedOption extends EnvRestrictedItems {\n\n /**\n * Overrides for specific subsets of files in the environment. All restricted\n * items of overrides will be merged with the common restricted items defined\n * for the entire environment.\n */\n overrides?: EnvRestrictedOverride[]\n}\n\n/**\n * Shared options for an environment preset: include and exclude files, add\n * more linter rules, and settings for restricted items.\n */\nexport interface EnvRestrictedOptions extends EnvBaseOptions {\n\n /**\n * All globals, imports, properties, and syntax constructs to be banned for\n * the files included by the environment.\n */\n restricted?: EnvRestrictedOption\n}\n\n// ----------------------------------------------------------------------------\n\n/**\n * Helper interface for type conversion.\n */\ninterface EnvRestrictedEntryTypeMap {\n globals: EnvRestrictedName\n imports: EnvRestrictedName\n properties: EnvRestrictedProperty\n syntax: EnvRestrictedSyntax\n}\n\ntype EnvRestrictedEntryKey = keyof EnvRestrictedEntryTypeMap\ntype EnvRestrictedEntryType = EnvRestrictedEntryTypeMap[EnvRestrictedEntryKey]\n\n// functions ==================================================================\n\n/**\n * Creates a rules configuration record for all restricted items.\n *\n * @param generator\n * The generator callback function that returns the restricted items to be\n * inserted into the linter rules.\n *\n * @returns\n * The rules configuration record containing entries for all existing\n * restricted items.\n */\nfunction createRulesConfig(generator: (key: EnvRestrictedEntryKey) => readonly EnvRestrictedEntryType[]): RulesConfig {\n const rules: RulesConfig = {}\n for (const key of ['globals', 'imports', 'properties', 'syntax'] as const) {\n const items = generator(key)\n if (items.length) rules[`no-restricted-${key}`] = ['error', ...items]\n }\n // same restrictions for CommonJS `require` as for `import` statements\n if ('no-restricted-imports' in rules) {\n rules['no-restricted-modules'] = rules['no-restricted-imports']\n }\n return rules\n}\n\n/**\n * Merges built-in items and custom items for restricted rules.\n *\n * @param restrictedItems\n * The custom items for restricted rules to be merged.\n *\n * @returns\n * The rules dictionary with all needed restricted rules.\n */\nfunction mergeRestrictedItems(...restrictedItems: Array<EnvRestrictedItems | undefined>): Required<EnvRestrictedItems> {\n\n const RESTRICTED_GLOBALS: EnvRestrictedName[] = [\n { name: 'isFinite', message: 'Use `Number.isFinite` instead.' },\n { name: 'isNaN', message: 'Use `Number.isNaN` instead.' },\n ]\n\n const RESTRICTED_SYNTAX: EnvRestrictedSyntax[] = [\n { selector: ':matches(PropertyDefinition, MethodDefinition[kind!=\"constructor\"])[accessibility=\"private\"]', message: 'Use `#private` syntax instead.' },\n ]\n\n // restricted items for all files in the environment\n return {\n globals: flattenDeepArrays(RESTRICTED_GLOBALS, restrictedItems.map(item => item?.globals)),\n imports: flattenDeepArrays(restrictedItems.map(item => item?.imports)),\n properties: flattenDeepArrays(restrictedItems.map(item => item?.properties)),\n syntax: flattenDeepArrays(RESTRICTED_SYNTAX, restrictedItems.map(item => item?.syntax)),\n }\n}\n\n// ----------------------------------------------------------------------------\n\n/**\n * Creates restricted rules with built-in restricted items only.\n *\n * @returns\n * The rules dictionary with all needed restricted rules.\n */\nexport function builtinRestrictedRules(): RulesConfig {\n\n // built-in restricted items\n const items = mergeRestrictedItems()\n\n // generate the rules dictionary\n return createRulesConfig(key => items[key])\n}\n\n/**\n * Generates various 'no-restricted-?' rules from the passed configuration.\n *\n * @param baseName\n * Base name for the configuration objects.\n *\n * @param envOptions\n * The environment options containing 'files', 'ignores', and 'restricted'\n * settings.\n *\n * @param fixed\n * The fixed restricted items provided by the environment preset.\n *\n * @returns\n * The configuration entries needed to forbid the restricted items.\n */\nexport function restrictedRulesConfig(baseName: string, envOptions: EnvRestrictedOptions, fixed?: EnvRestrictedItems): ConfigArg {\n\n const { restricted } = envOptions\n\n // restricted items for all files in the environment\n const items = mergeRestrictedItems(fixed, restricted)\n\n // generate the configuration objects\n return [\n\n // base rules for all files in the environment\n createConfig(baseName, envOptions, {\n rules: createRulesConfig(key => items[key]),\n }),\n\n // generate the override entries (join with base items)\n restricted?.overrides?.map((override, index) => createConfig(`${baseName}.override-${index}`, override, {\n rules: createRulesConfig(key => flattenDeepArrays<EnvRestrictedEntryType>(items[key], override[key])),\n })),\n ]\n}\n","\nimport type { ConfigObject } from '@eslint/core'\nimport eslintJs from '@eslint/js'\n\nimport type { ConfigArg, LanguageConfig } from '@/eslint/shared/env-utils.ts'\nimport { SRC_GLOB, VUE_GLOB, NO_IMPLICIT_COERCION_OPTIONS, extGlob } from '@/eslint/shared/env-utils.ts'\nimport { builtinRestrictedRules } from '@/eslint/shared/restricted.ts'\n\n// functions ==================================================================\n\n/**\n * Defines standard module settings and additional rules targeting JavaScript\n * _and_ TypeScript source files.\n *\n * Wraps the following packages:\n * - `@eslint/js`\n *\n * @param languageConfig\n * Resolved configuration options.\n *\n * @returns\n * The configuration entries to be added to the resulting configuration array.\n */\nexport default function base(languageConfig: LanguageConfig): ConfigArg {\n\n // returns language options for specific file extensions\n const languageOptions = (sourceType: LanguageConfig['sourceType'], ...extensions: string[]): ConfigObject => {\n const { ecmaVersion } = languageConfig\n return {\n name: `core.base.language-options.${sourceType}.${extensions.join(',')}`,\n files: extGlob(extensions),\n languageOptions: { ecmaVersion, sourceType },\n }\n }\n\n return [\n\n // global linter configuration\n {\n name: 'core.base.linter-options',\n linterOptions: {\n // report unused inline linter directives in source code\n reportUnusedDisableDirectives: 'error',\n reportUnusedInlineConfigs: 'error',\n },\n },\n\n // ECMA version and module type for ES modules\n languageOptions('module', 'mjs', 'mts'),\n\n // ECMA version and module type for CommonJS modules\n languageOptions('commonjs', 'cjs', 'cts'),\n\n // ECMA version and module type for *.js and *.ts files\n languageOptions(languageConfig.sourceType, 'js', 'jsx', 'ts', 'tsx'),\n\n // configure linter rules\n {\n name: 'core.base.rules',\n files: [...SRC_GLOB, ...VUE_GLOB],\n rules: {\n // enable all rules recommended by ESLint itself\n ...eslintJs.configs.recommended.rules,\n // possible problems\n 'no-cond-assign': ['error', 'except-parens'],\n 'no-constant-binary-expression': 'error',\n 'no-constructor-return': 'error',\n 'no-control-regex': 'off',\n 'no-duplicate-imports': ['error', { allowSeparateTypeImports: true }],\n 'no-new-native-nonconstructor': 'error',\n 'no-new-symbol': 'off', // disabled in favour of 'no-new-native-nonconstructor'\n 'no-promise-executor-return': ['error', { allowVoid: true }],\n 'no-self-compare': 'error',\n 'no-template-curly-in-string': 'error',\n 'no-unassigned-vars': 'error',\n 'no-unreachable-loop': 'error',\n 'no-unsafe-optional-chaining': ['error', { disallowArithmeticOperators: true }],\n 'no-unused-private-class-members': 'off', // separate rules for JS and TS\n 'require-atomic-updates': 'error',\n // suggestions\n 'block-scoped-var': 'error',\n curly: ['error', 'multi-line'],\n eqeqeq: 'error',\n 'grouped-accessor-pairs': 'error',\n 'new-cap': 'error',\n 'no-alert': 'error',\n 'no-caller': 'error',\n 'no-console': 'error',\n 'no-else-return': 'error',\n 'no-empty': 'off',\n 'no-empty-static-block': 'error',\n 'no-eval': 'error',\n 'no-extend-native': 'error',\n 'no-extra-bind': 'error',\n 'no-extra-label': 'error',\n 'no-implicit-coercion': ['error', NO_IMPLICIT_COERCION_OPTIONS],\n 'no-implied-eval': 'error',\n 'no-iterator': 'error',\n 'no-label-var': 'error',\n 'no-labels': 'error',\n 'no-lone-blocks': 'error',\n 'no-lonely-if': 'error',\n 'no-multi-str': 'error',\n 'no-new': 'error',\n 'no-new-func': 'error',\n 'no-new-wrappers': 'error',\n 'no-object-constructor': 'error',\n 'no-octal-escape': 'error',\n 'no-proto': 'error',\n 'no-return-assign': ['error', 'except-parens'],\n 'no-script-url': 'error',\n 'no-sequences': ['error', { allowInParentheses: false }],\n 'no-unneeded-ternary': ['error', { defaultAssignment: false }],\n 'no-unused-expressions': 'error',\n 'no-useless-assignment': 'error',\n 'no-useless-call': 'error',\n 'no-useless-computed-key': 'error',\n 'no-useless-concat': 'error',\n 'no-useless-rename': 'error',\n 'no-useless-return': 'error',\n 'no-var': 'error',\n 'object-shorthand': 'error',\n 'operator-assignment': 'error',\n 'prefer-arrow-callback': 'error',\n 'prefer-const': ['error', { destructuring: 'all', ignoreReadBeforeAssign: true }],\n 'prefer-numeric-literals': 'error',\n 'prefer-regex-literals': 'error',\n 'prefer-rest-params': 'error',\n 'prefer-spread': 'error',\n radix: 'error',\n 'symbol-description': 'error',\n // built-in restricted items\n ...builtinRestrictedRules(),\n },\n },\n ]\n}\n","\nimport { type ConfigArg, JS_GLOB, NO_UNUSED_VARS_OPTIONS } from '@/eslint/shared/env-utils.ts'\n\n// functions ==================================================================\n\n/**\n * Defines additional standard rules targeting JavaScript but _not_ TypeScript\n * source files.\n *\n * @returns\n * The configuration entries to be added to the resulting configuration array.\n */\nexport default function js(): ConfigArg {\n\n return {\n name: 'core.js.recommended',\n files: JS_GLOB,\n rules: {\n // possible problems\n 'no-loss-of-precision': 'off',\n 'no-unused-vars': ['error', NO_UNUSED_VARS_OPTIONS],\n // suggestions\n 'default-param-last': 'error',\n 'dot-notation': 'error',\n 'no-array-constructor': 'error',\n 'no-invalid-this': 'error',\n 'no-loop-func': 'error',\n 'no-redeclare': 'error',\n 'no-shadow': ['error', { ignoreOnInitialization: true }],\n 'no-throw-literal': 'error',\n 'no-unused-private-class-members': 'error',\n 'no-useless-constructor': 'error',\n 'prefer-promise-reject-errors': 'error',\n 'require-await': 'error',\n },\n }\n}\n","\nimport type { RulesConfig } from '@eslint/core'\nimport { configs as pluginConfigs } from 'typescript-eslint'\n\nimport type { ConfigArg } from '@/eslint/shared/env-utils.ts'\nimport { SRC_GLOB, TS_GLOB, DTS_GLOB, VUE_GLOB, NO_UNUSED_VARS_OPTIONS } from '@/eslint/shared/env-utils.ts'\n\n// types ======================================================================\n\nexport type TSESLintConfigKey = keyof typeof pluginConfigs\n\n// constants ==================================================================\n\n/**\n * Names of all `typescript-eslint` presets to be included\n */\nexport const TSESLINT_PRESETS = ['strictTypeChecked', 'stylisticTypeChecked'] as const satisfies TSESLintConfigKey[]\n\n/**\n * Custom configuration for `typescript-eslint` rules.\n */\nexport const TSESLINT_RULES = {\n '@typescript-eslint/array-type': 'off',\n '@typescript-eslint/consistent-indexed-object-style': 'off',\n '@typescript-eslint/consistent-type-exports': 'error',\n '@typescript-eslint/consistent-type-imports': ['error', { disallowTypeAnnotations: false }],\n '@typescript-eslint/default-param-last': 'error',\n '@typescript-eslint/explicit-function-return-type': ['error', {\n allowExpressions: true,\n allowTypedFunctionExpressions: true,\n allowHigherOrderFunctions: true,\n allowConciseArrowFunctionExpressionsStartingWithVoid: true,\n }],\n '@typescript-eslint/explicit-member-accessibility': ['error', { accessibility: 'no-public', overrides: { constructors: 'off' } }],\n '@typescript-eslint/no-confusing-void-expression': 'off',\n '@typescript-eslint/no-dynamic-delete': 'off',\n '@typescript-eslint/no-empty-function': ['error', {\n allow: ['private-constructors', 'protected-constructors', 'decoratedFunctions', 'overrideMethods'],\n }],\n '@typescript-eslint/no-empty-object-type': ['error', { allowInterfaces: 'always' }],\n '@typescript-eslint/no-explicit-any': 'off',\n '@typescript-eslint/no-import-type-side-effects': 'error',\n '@typescript-eslint/no-invalid-this': 'error',\n '@typescript-eslint/no-invalid-void-type': 'off',\n '@typescript-eslint/no-loop-func': 'error',\n '@typescript-eslint/no-misused-spread': 'error',\n '@typescript-eslint/no-namespace': ['error', { allowDeclarations: true }],\n '@typescript-eslint/no-non-null-assertion': 'off',\n '@typescript-eslint/no-redeclare': 'error',\n '@typescript-eslint/no-shadow': ['error', { ignoreOnInitialization: true }],\n '@typescript-eslint/no-unnecessary-qualifier': 'error',\n // disabled temporarily: https://github.com/typescript-eslint/typescript-eslint/issues/12158\n '@typescript-eslint/no-unnecessary-type-arguments': 'off',\n '@typescript-eslint/no-unnecessary-type-conversion': 'error',\n '@typescript-eslint/no-unnecessary-type-parameters': 'off',\n '@typescript-eslint/no-unsafe-declaration-merging': 'off',\n '@typescript-eslint/no-unused-private-class-members': 'error',\n '@typescript-eslint/no-unused-vars': ['error', NO_UNUSED_VARS_OPTIONS],\n '@typescript-eslint/parameter-properties': 'error',\n '@typescript-eslint/prefer-nullish-coalescing': ['error', { ignorePrimitives: true }],\n '@typescript-eslint/prefer-readonly': 'error',\n '@typescript-eslint/prefer-reduce-type-parameter': 'off',\n '@typescript-eslint/restrict-template-expressions': 'off',\n '@typescript-eslint/return-await': ['error', 'always'],\n '@typescript-eslint/strict-void-return': ['error', { allowReturnAny: true }],\n '@typescript-eslint/switch-exhaustiveness-check': ['error', { considerDefaultExhaustiveForUnions: true }],\n '@typescript-eslint/unified-signatures': ['error', { ignoreDifferentlyNamedParameters: true }],\n} as const satisfies RulesConfig\n\n// functions ==================================================================\n\n/**\n * Defines standard rules for TypeScript source files.\n *\n * Wraps the following packages:\n * - `typescript-eslint`\n *\n * @param rootDir\n * The project root directory.\n *\n * @returns\n * The configuration entries to be added to the resulting configuration array.\n */\nexport default function ts(rootDir: string): ConfigArg {\n\n // plugin configuration, additional rules\n return [\n\n {\n name: 'core.ts.options',\n files: [...SRC_GLOB, ...VUE_GLOB],\n languageOptions: {\n parserOptions: {\n projectService: true,\n tsconfigRootDir: rootDir,\n // suppress warning for new TypeScript versions\n warnOnUnsupportedTypeScriptVersion: false,\n },\n },\n },\n\n {\n name: 'core.ts.recommended',\n files: TS_GLOB,\n\n // recommended rules\n extends: TSESLINT_PRESETS.map(key => pluginConfigs[key]),\n\n // reconfigure plugin rules\n rules: TSESLINT_RULES,\n },\n\n // fixes for module definition files\n {\n name: 'core.ts.dts',\n files: DTS_GLOB,\n rules: {\n 'no-duplicate-imports': 'off', // triggers for multiple 'declare' blocks in a file\n '@typescript-eslint/consistent-type-exports': 'off',\n '@typescript-eslint/consistent-type-imports': ['error', { prefer: 'no-type-imports', disallowTypeAnnotations: false }],\n '@typescript-eslint/no-extraneous-class': 'off',\n '@typescript-eslint/no-unused-private-class-members': 'off', // allow to declare private class members\n '@typescript-eslint/prefer-readonly': 'off', // allow to declare class members without 'readonly'\n },\n },\n ]\n}\n","\nimport vuePlugin from 'eslint-plugin-vue'\nimport { configureVueProject, defineConfigWithVueTs, vueTsConfigs } from '@vue/eslint-config-typescript'\n\nimport type { ConfigArg, StylisticConfig } from '@/eslint/shared/env-utils.ts'\nimport { VUE_GLOB, NO_IMPLICIT_COERCION_OPTIONS, getCommaDangleConfig } from '@/eslint/shared/env-utils.ts'\n\nimport { TSESLINT_PRESETS, TSESLINT_RULES } from './ts.ts'\n\n// functions ==================================================================\n\n/**\n * Configuration options for Vue source files.\n */\nexport interface VueOptions {\n\n /**\n * Names of all globally registered directives to be ignored by the rule\n * `vue/no-undef-directives` (without 'v-' prefix).\n */\n globalDirectives?: readonly string[]\n}\n\n// functions ==================================================================\n\n/**\n * Creates configuration objects with linter rules for Vue.js.\n *\n * Wraps the following packages:\n * - `eslint-plugin-vue`\n * - `@vue/eslint-config-typescript`\n *\n * @param rootDir\n * The project root directory.\n *\n * @param stylisticConfig\n * Resolved stylistic configuration options.\n *\n * @param vueOptions\n * Additional configuration for Vue specific rules.\n *\n * @returns\n * The configuration entries to be added to the resulting configuration array.\n */\nexport default function vue(rootDir: string, stylisticConfig: StylisticConfig, vueOptions: VueOptions | undefined): ConfigArg {\n\n // configuration properties\n const { indentOverrides: indent } = stylisticConfig\n\n configureVueProject({ rootDir, allowComponentTypeUnsafety: false })\n\n // recommended configuration of the main plugin\n const recommendedConfigs = vuePlugin.configs['flat/recommended-error']\n\n return defineConfigWithVueTs(\n\n // register rule implementations and recommended rules, raise all recommended rules to 'error' level\n recommendedConfigs.map((config, index) => ({\n ...config,\n name: `core.vue.recommended-${index}`,\n })),\n\n // reconfigure plugin rules\n {\n name: 'core.vue.rules',\n rules: {\n 'no-undef': 'off',\n 'no-unused-vars': 'off',\n 'no-useless-assignment': 'off',\n 'vue/component-api-style': 'error',\n 'vue/define-emits-declaration': 'error',\n 'vue/define-macros-order': 'error',\n 'vue/define-props-declaration': 'error',\n 'vue/eqeqeq': 'error',\n 'vue/html-button-has-type': 'error',\n 'vue/max-attributes-per-line': 'off',\n 'vue/no-console': 'error',\n 'vue/no-duplicate-class-names': 'error',\n 'vue/no-empty-pattern': 'error',\n 'vue/no-implicit-coercion': ['error', NO_IMPLICIT_COERCION_OPTIONS],\n 'vue/no-irregular-whitespace': 'error',\n 'vue/no-literals-in-template': 'error',\n 'vue/no-sparse-arrays': 'error',\n 'vue/no-template-target-blank': 'error',\n 'vue/no-undef-directives': ['error', { ignore: vueOptions?.globalDirectives }],\n 'vue/no-use-v-else-with-v-for': 'error',\n 'vue/no-useless-concat': 'error',\n 'vue/no-useless-v-bind': 'error',\n 'vue/object-shorthand': 'error',\n 'vue/padding-line-between-blocks': 'error',\n 'vue/prefer-define-options': 'error',\n 'vue/prefer-single-event-payload': 'error',\n 'vue/prefer-true-attribute-shorthand': 'error',\n 'vue/prefer-use-template-ref': 'error',\n 'vue/prefer-v-model': 'error',\n 'vue/require-explicit-slots': 'error',\n 'vue/require-typed-ref': 'error',\n 'vue/singleline-html-element-content-newline': 'off',\n // stylistic extensions\n 'vue/array-bracket-spacing': 'error',\n 'vue/arrow-spacing': 'error',\n 'vue/block-spacing': 'error',\n 'vue/brace-style': ['error', '1tbs', { allowSingleLine: true }],\n 'vue/comma-dangle': getCommaDangleConfig(stylisticConfig),\n 'vue/comma-spacing': 'error',\n 'vue/comma-style': 'error',\n 'vue/dot-notation': 'error',\n 'vue/func-call-spacing': 'error',\n 'vue/html-indent': ['error', indent.vue],\n 'vue/key-spacing': ['error', { mode: 'minimum' }],\n 'vue/keyword-spacing': 'error',\n 'vue/object-curly-spacing': ['error', 'always'],\n 'vue/quote-props': ['error', 'as-needed'],\n 'vue/space-in-parens': 'error',\n 'vue/space-infix-ops': 'error',\n 'vue/space-unary-ops': 'error',\n 'vue/template-curly-spacing': 'error',\n // @stylistic plugin\n '@stylistic/indent': ['error', indent.vue, { SwitchCase: 1, MemberExpression: 'off', flatTernaryExpressions: true }],\n },\n },\n\n // create recommended typescript-eslint rules\n ...TSESLINT_PRESETS.map(key => vueTsConfigs[key]),\n\n {\n name: 'core.vue.ts.rules',\n rules: TSESLINT_RULES,\n },\n\n ).map(config => ({ ...config, files: VUE_GLOB })) // restrict all configurations to Vue files\n}\n","\nimport jsonPlugin from 'eslint-plugin-jsonc'\n\nimport type { ConfigArg, StylisticConfig } from '@/eslint/shared/env-utils.ts'\nimport { fixMissingFilesOption } from '@/eslint/shared/env-utils.ts'\n\n// functions ==================================================================\n\n/**\n * Defines standard linting rules for JSON files.\n *\n * Wraps the following packages:\n * - `eslint-plugin-jsonc`\n *\n * @param stylisticConfig\n * Resolved configuration options.\n *\n * @returns\n * The configuration entries to be added to the resulting configuration array.\n */\nexport default function json(stylisticConfig: StylisticConfig): ConfigArg {\n\n // configuration properties\n const { indentOverrides: indent } = stylisticConfig\n\n // add missing 'files' property in configurations with rules (otherwise, plugin conflicts with '@eslint/markdown')\n return fixMissingFilesOption(\n\n // register rule implementations and recommended rules\n jsonPlugin.configs['flat/recommended-with-json'].map((config, index) => ({\n ...config,\n name: `core.json.recommended-${index}`,\n })),\n\n // reconfigure plugin rules\n {\n name: 'core.json.rules',\n rules: {\n 'jsonc/array-bracket-spacing': 'error',\n 'jsonc/comma-style': 'error',\n 'jsonc/indent': ['error', indent.json],\n 'jsonc/key-spacing': ['error', { mode: 'minimum' }],\n 'jsonc/no-irregular-whitespace': 'error',\n 'jsonc/no-octal-escape': 'error',\n },\n },\n\n {\n name: 'core.json.tsconfig',\n files: ['**/tsconfig.json', '**/tsconfig.*.json'],\n rules: {\n 'jsonc/no-comments': 'off',\n },\n },\n )\n}\n","\nimport yamlPlugin from 'eslint-plugin-yml'\n\nimport type { ConfigArg, StylisticConfig } from '@/eslint/shared/env-utils.ts'\nimport { fixMissingFilesOption } from '@/eslint/shared/env-utils.ts'\n\n// functions ==================================================================\n\n/**\n * Defines standard linting rules for YAML files.\n *\n * Wraps the following packages:\n * - `eslint-plugin-yml`\n *\n * @param stylisticConfig\n * Resolved configuration options.\n *\n * @returns\n * The configuration entries to be added to the resulting configuration array.\n */\nexport default function yaml(stylisticConfig: StylisticConfig): ConfigArg {\n\n // configuration properties\n const { indentOverrides: indent } = stylisticConfig\n\n // add missing 'files' property in configurations with rules (otherwise, plugin conflicts with '@eslint/markdown')\n return fixMissingFilesOption(\n\n // register rule implementations and recommended rules\n yamlPlugin.configs.recommended.map((config, index) => ({\n ...config,\n name: `core.yaml.recommended-${index}`,\n })),\n\n // reconfigure plugin rules\n {\n name: 'core.yaml.rules',\n rules: {\n 'yml/indent': ['error', indent.yaml],\n 'yml/key-spacing': ['error', { mode: 'minimum' }],\n 'yml/require-string-key': 'error',\n },\n },\n )\n}\n","\nimport markdownPlugin from '@eslint/markdown'\n\nimport type { ConfigArg } from '@/eslint/shared/env-utils.ts'\n\n// functions ==================================================================\n\n/**\n * Defines standard linting rules for Markdown files.\n *\n * Wraps the following packages:\n * - `@eslint/markdown`\n *\n * @returns\n * The configuration entries to be added to the resulting configuration array.\n */\nexport default function markdown(): ConfigArg {\n return markdownPlugin.configs.recommended.map((config, index) => ({\n ...config,\n name: `core.markdown.recommended-${index}`,\n }))\n}\n","\nimport licensePlugin from 'eslint-plugin-license-header'\n\nimport { type ConfigArg, SRC_GLOB } from '@/eslint/shared/env-utils.ts'\n\n// functions ==================================================================\n\n/**\n * Checks the existence of license headers in source files.\n *\n * Wraps the following packages:\n * - `eslint-plugin-license-header`\n *\n * @param path\n * Absolute path to the template file containing the license header.\n *\n * @returns\n * The configuration entries to be added to the resulting configuration array.\n */\nexport default function license(path: string): ConfigArg {\n\n return {\n name: 'core.license.plugin',\n files: SRC_GLOB,\n\n // register rule implementations of the plugin\n plugins: {\n 'license-header': licensePlugin,\n },\n\n // configure plugin rules\n rules: {\n 'license-header/header': ['error', path],\n },\n }\n}\n","\nimport commentsPluginConfigs from '@eslint-community/eslint-plugin-eslint-comments/configs'\n\nimport { type ConfigArg, SRC_GLOB, VUE_GLOB, createConfig } from '@/eslint/shared/env-utils.ts'\n\n// functions ==================================================================\n\n/**\n * Checks inline linter directives.\n *\n * Wraps the following packages:\n * - `eslint-plugin-eslint-comments`\n *\n * @returns\n * The configuration entries to be added to the resulting configuration array.\n */\nexport default function directives(): ConfigArg {\n\n // register rule implementations and recommended rules\n return createConfig('core.directives.recommended', {\n files: [...SRC_GLOB, ...VUE_GLOB],\n }, commentsPluginConfigs.recommended, {\n '@eslint-community/eslint-comments/disable-enable-pair': ['error', { allowWholeFile: true }],\n })\n}\n","\nimport * as dependPlugin from 'eslint-plugin-depend'\n\nimport type { ConfigArg, PackagesConfig } from '@/eslint/shared/env-utils.ts'\n\n// functions ==================================================================\n\n/**\n * Defines linting rules for outdated or unneeded external dependencies.\n *\n * Wraps the following packages:\n * - `eslint-plugin-depend`\n *\n * @param packagesConfig\n * Resolved configuration options.\n *\n * @returns\n * The configuration entries to be added to the resulting configuration array.\n */\nexport default function packages(packagesConfig: PackagesConfig): ConfigArg {\n\n return [\n\n // register rule implementations and recommended rules\n {\n ...dependPlugin.configs['flat/recommended'],\n name: 'core.packages.recommended',\n },\n\n {\n name: 'core.packages.rules',\n rules: {\n 'depend/ban-dependencies': ['error', {\n modules: packagesConfig.banned,\n allowed: packagesConfig.allowed,\n }],\n },\n },\n ]\n}\n","\nimport * as regexpPlugin from 'eslint-plugin-regexp'\n\nimport { type ConfigArg, SRC_GLOB, convertRuleWarningsToErrors } from '@/eslint/shared/env-utils.ts'\n\n// functions ==================================================================\n\n/**\n * Checks the regular expressions in source files.\n *\n * Wraps the following packages:\n * - `eslint-plugin-regexp`\n *\n * @returns\n * The configuration entries to be added to the resulting configuration array.\n */\nexport default function regexp(): ConfigArg {\n\n // recommended configuration of the plugin\n const recommendedConfig = regexpPlugin.configs.recommended\n\n // register rule implementations and recommended rules\n return {\n files: SRC_GLOB,\n // raise all recommended rules to 'error' level\n ...convertRuleWarningsToErrors(recommendedConfig),\n name: 'core.regexp.recommended',\n }\n}\n","\nimport promisePlugin from 'eslint-plugin-promise'\n\nimport type { ConfigArg } from '@/eslint/shared/env-utils.ts'\n\n// functions ==================================================================\n\n/**\n * Checks for correct usage of native promises.\n *\n * Wraps the following packages:\n * - `eslint-plugin-promise`\n *\n * @returns\n * The configuration entries to be added to the resulting configuration array.\n */\nexport default function promises(): ConfigArg {\n\n return [\n\n // register rule implementations and recommended rules\n {\n ...promisePlugin.configs['flat/recommended'],\n name: 'core.promises.recommended',\n },\n\n // reconfigure plugin rules\n {\n name: 'core.promises.rules',\n rules: {\n 'promise/always-return': ['error', { ignoreLastCallback: true }],\n 'promise/no-callback-in-promise': 'off',\n 'promise/no-nesting': 'error', // warning => error\n 'promise/no-return-in-finally': 'error',\n 'promise/valid-params': 'error', // warning => error\n },\n },\n ]\n}\n","\nimport { jsdoc as jsdocPlugin } from 'eslint-plugin-jsdoc'\n\nimport { type ConfigArg, TS_GLOB, SRC_GLOB } from '@/eslint/shared/env-utils.ts'\n\n// functions ==================================================================\n\n/**\n * Checks the JSDoc comments in source files.\n *\n * Wraps the following packages:\n * - `eslint-plugin-jsdoc`\n *\n * @returns\n * The configuration entries to be added to the resulting configuration array.\n */\nexport default function jsdoc(): ConfigArg {\n\n return [\n\n // register rule implementations and recommended rules\n {\n files: SRC_GLOB,\n ...jsdocPlugin({\n config: 'flat/recommended-error',\n settings: {\n tagNamePreference: {\n // disallowed tags for ES6 keywords `const`, `class`\n augments: false,\n class: false,\n const: false,\n constant: false,\n 'tag constructor': false,\n },\n },\n }),\n name: 'core.jsdoc.recommended',\n },\n\n // overrides for TypeScript files\n {\n files: TS_GLOB,\n ...jsdocPlugin({\n config: 'flat/recommended-typescript-error',\n settings: {\n structuredTags: {\n // '@yields' tags in TypeScript do not need a type\n yields: {\n type: false,\n },\n },\n },\n rules: {\n 'jsdoc/check-param-names': ['error', { allowExtraTrailingParamDocs: true }], // overload signatures\n 'jsdoc/require-yields-type': 'off',\n },\n }),\n name: 'core.jsdoc.typescript',\n },\n\n // configure plugin rules\n // Note: These custom override rules must be located after the TS setup block above (instead of adding them\n // to the 'rules' option inside the leading 'flat/recommended-error' block), otherwise they would be\n // overwritten for all TS files.\n {\n name: 'core.jsdoc.rules',\n files: SRC_GLOB,\n rules: {\n 'jsdoc/check-template-names': 'error',\n 'jsdoc/escape-inline-tags': 'error',\n 'jsdoc/require-asterisk-prefix': 'error',\n 'jsdoc/require-jsdoc': ['error', { contexts: ['ClassDeclaration', 'TSInterfaceDeclaration'] }],\n 'jsdoc/require-template': ['error', { requireSeparateTemplates: true }],\n 'jsdoc/require-template-description': 'error',\n 'jsdoc/require-throws': 'error',\n 'jsdoc/require-throws-description': 'error',\n 'jsdoc/require-yields-description': 'error',\n 'jsdoc/tag-lines': 'off',\n 'jsdoc/ts-no-unnecessary-template-expression': 'error',\n },\n },\n ]\n}\n","\nimport stylisticPlugin from '@stylistic/eslint-plugin'\nimport migratePlugin from '@stylistic/eslint-plugin-migrate'\n\nimport type { ConfigArg, StylisticConfig } from '@/eslint/shared/env-utils.ts'\nimport { getCommaDangleConfig } from '@/eslint/shared/env-utils.ts'\n\n// functions ==================================================================\n\n/**\n * Defines standard (opinionated) linter rules for source code style.\n *\n * Wraps the following packages:\n * - `@stylistic/eslint-plugin`\n * - `@stylistic/eslint-plugin-migrate`\n *\n * @param stylisticConfig\n * Resolved configuration options.\n *\n * @returns\n * The configuration entries to be added to the resulting configuration array.\n */\nexport default function stylistic(stylisticConfig: StylisticConfig): ConfigArg {\n\n // configuration properties\n const { indentOverrides: indent, semi, quotes, funcSpacing } = stylisticConfig\n\n return [\n\n // globally disable all deprecated stylistic core rules\n {\n ...stylisticPlugin.configs['disable-legacy'],\n name: 'core.stylistic.disable-legacy',\n },\n\n // '@stylistic' plugin\n {\n name: 'core.stylistic.recommended',\n\n // do not lint markdown files\n ignores: ['**/*.md'],\n\n // register rule implementations of the plugins\n plugins: {\n '@stylistic': stylisticPlugin,\n },\n\n // configure plugin rules\n rules: {\n '@stylistic/array-bracket-spacing': 'error',\n '@stylistic/arrow-spacing': 'error',\n '@stylistic/block-spacing': 'error',\n '@stylistic/brace-style': ['error', '1tbs', { allowSingleLine: true }],\n '@stylistic/comma-dangle': getCommaDangleConfig(stylisticConfig),\n '@stylistic/comma-spacing': 'error',\n '@stylistic/comma-style': 'error',\n '@stylistic/computed-property-spacing': 'error',\n '@stylistic/eol-last': 'error',\n '@stylistic/function-call-spacing': 'error',\n '@stylistic/generator-star-spacing': 'error',\n '@stylistic/indent': ['error', indent.js, { SwitchCase: 1, MemberExpression: 'off', flatTernaryExpressions: true }],\n '@stylistic/indent-binary-ops': ['error', indent.js],\n '@stylistic/jsx-child-element-spacing': 'error',\n '@stylistic/jsx-curly-brace-presence': 'error',\n '@stylistic/jsx-curly-spacing': 'error',\n '@stylistic/jsx-equals-spacing': 'error',\n '@stylistic/jsx-function-call-newline': 'error',\n '@stylistic/jsx-indent-props': ['error', indent.js],\n '@stylistic/jsx-one-expression-per-line': 'off',\n '@stylistic/jsx-pascal-case': 'error',\n '@stylistic/jsx-quotes': 'error',\n '@stylistic/jsx-self-closing-comp': 'error',\n '@stylistic/jsx-wrap-multilines': 'error',\n '@stylistic/key-spacing': ['error', { mode: 'minimum' }],\n '@stylistic/keyword-spacing': 'error',\n '@stylistic/linebreak-style': 'error',\n '@stylistic/member-delimiter-style': (semi === 'off') ? 'off' : ['error', {\n multiline: { delimiter: (semi === 'always') ? 'semi' : 'none', requireLast: true },\n singleline: { delimiter: (semi === 'always') ? 'semi' : 'comma', requireLast: false },\n }],\n '@stylistic/new-parens': 'error',\n '@stylistic/no-extra-semi': 'error',\n '@stylistic/no-floating-decimal': 'error',\n '@stylistic/no-mixed-operators': ['error', {\n groups: [\n // allow to mix arithmetic operators\n // ['+', '-', '*', '/', '%', '**'],\n ['&', '|', '^', '~', '<<', '>>', '>>>'],\n ['==', '!=', '===', '!==', '>', '>=', '<', '<='],\n ['&&', '||'],\n ['in', 'instanceof'],\n ],\n allowSamePrecedence: true,\n }],\n '@stylistic/no-multiple-empty-lines': ['error', { max: 2 }],\n '@stylistic/no-tabs': 'error',\n '@stylistic/no-trailing-spaces': 'error',\n '@stylistic/no-whitespace-before-property': 'error',\n '@stylistic/object-curly-spacing': ['error', 'always'],\n '@stylistic/quote-props': ['error', 'as-needed'],\n '@stylistic/quotes': (quotes === 'off') ? 'off' : ['error', quotes, { avoidEscape: true }],\n '@stylistic/rest-spread-spacing': 'error',\n '@stylistic/semi': (semi === 'off') ? 'off' : ['error', semi],\n '@stylistic/semi-spacing': 'error',\n '@stylistic/semi-style': 'error',\n '@stylistic/space-before-blocks': 'error',\n '@stylistic/space-before-function-paren': ['error', {\n anonymous: 'always',\n named: (funcSpacing === 'off') ? 'ignore' : funcSpacing,\n asyncArrow: 'always',\n catch: 'always',\n }],\n '@stylistic/space-in-parens': 'error',\n '@stylistic/space-infix-ops': 'error',\n '@stylistic/space-unary-ops': 'error',\n '@stylistic/switch-colon-spacing': 'error',\n '@stylistic/template-curly-spacing': 'error',\n '@stylistic/template-tag-spacing': 'error',\n '@stylistic/type-annotation-spacing': 'error',\n '@stylistic/type-generic-spacing': 'error',\n '@stylistic/type-named-tuple-spacing': 'error',\n '@stylistic/wrap-iife': 'error',\n '@stylistic/yield-star-spacing': 'error',\n },\n },\n\n // '@stylistic/migrate' plugin\n {\n name: 'core.stylistic.migrate',\n\n // register rule implementations of the plugins\n plugins: {\n '@stylistic/migrate': migratePlugin,\n },\n\n // configure plugin rules\n rules: {\n '@stylistic/migrate/migrate-js': 'error',\n '@stylistic/migrate/migrate-ts': 'error',\n '@stylistic/migrate/migrate-jsx': 'error',\n },\n },\n ]\n}\n","\nimport nodePlugin from 'eslint-plugin-n'\nimport type ts from 'typescript'\n\nimport type { ConfigArg, LanguageOptions } from '@/eslint/shared/env-utils.ts'\nimport { createConfig, customRules } from '@/eslint/shared/env-utils.ts'\nimport { type EnvRestrictedOptions, restrictedRulesConfig } from '@/eslint/shared/restricted.ts'\n\n// types ======================================================================\n\nexport type EnvNodeConvertPathPattern = [pattern: string, replacement: string]\n\n/**\n * Configuration for the record-style setting 'convertPath' of the plugin\n * `eslint-plugin-n`.\n */\nexport type EnvNodeConvertPathRecord = Record<string, EnvNodeConvertPathPattern>\n\n/**\n * Configuration for the elements in the array-style setting 'convertPath' of\n * the plugin `eslint-plugin-n`.\n */\nexport interface EnvNodeConvertPathElement {\n include: string[]\n exclude?: string[]\n replace: EnvNodeConvertPathPattern\n}\n\n/**\n * Shared settings for the plugin `eslint-plugin-n`.\n */\nexport interface EnvNodeSharedSettings {\n version?: string\n allowModules?: string[]\n resolvePaths?: string[]\n convertPath?: EnvNodeConvertPathRecord | EnvNodeConvertPathElement[]\n tryExtensions?: string[]\n tsconfigPath?: string[]\n typescriptExtensionMap?: ts.server.protocol.JsxEmit | Array<[string, string]>\n}\n\n/**\n * Configuration options for the environment preset 'env.node'.\n */\nexport interface EnvNodeOptions extends EnvRestrictedOptions {\n\n /**\n * The module mode used by the linted files.\n *\n * @default 'module'\n */\n sourceType?: LanguageOptions['sourceType']\n\n /**\n * Shared settings for the plugin `eslint-plugin-n`. Will be merged into the\n * settings object with the key 'n'.\n */\n settings?: EnvNodeSharedSettings\n}\n\n// functions ==================================================================\n\n/**\n * Creates configuration objects with global symbols and linter rules for\n * NodeJS modules.\n *\n * Wraps the following packages:\n * - `eslint-plugin-n`\n *\n * @param envOptions\n * Configuration options for the environment.\n *\n * @returns\n * The configuration entries to be added to the resulting configuration array.\n */\nexport default function node(envOptions: EnvNodeOptions): ConfigArg {\n\n // the plugin configuration key, according to source module type\n const configKey = (envOptions.sourceType === 'commonjs') ? 'flat/recommended-script' : 'flat/recommended-module'\n\n return [\n\n // register rule implementations\n createConfig('env.node.recommended', envOptions, {\n ...nodePlugin.configs[configKey],\n settings: {\n n: {\n tryExtensions: ['.js', '.ts', '.d.ts'], // automatically add missing extensions in imports\n ...envOptions.settings,\n },\n },\n }),\n\n // generate the 'no-restricted-?' rules according to passed configuration\n restrictedRulesConfig('env.node.restricted', envOptions),\n\n // custom rules\n customRules('env.node.rules', envOptions, {\n 'no-console': 'off',\n 'n/no-missing-import': 'off',\n 'n/no-unsupported-features/node-builtins': ['error', { allowExperimental: true }],\n 'n/prefer-global/buffer': 'error',\n 'n/prefer-global/console': 'error',\n 'n/prefer-global/crypto': 'error',\n 'n/prefer-global/process': 'error',\n 'n/prefer-global/text-decoder': 'error',\n 'n/prefer-global/text-encoder': 'error',\n 'n/prefer-global/timers': 'error',\n 'n/prefer-global/url': 'error',\n 'n/prefer-global/url-search-params': 'error',\n 'n/prefer-node-protocol': 'error',\n }),\n ]\n}\n","\nimport JAVASCRIPT_GLOBALS from 'globals'\nimport CONFUSING_BROWSER_GLOBALS from 'confusing-browser-globals'\nimport sanitizedPlugin from 'eslint-plugin-no-unsanitized'\n\nimport { type ConfigArg, createConfig, customRules } from '@/eslint/shared/env-utils.ts'\nimport type { EnvRestrictedName, EnvRestrictedProperty, EnvRestrictedSyntax, EnvRestrictedOptions } from '@/eslint/shared/restricted.ts'\nimport { restrictedRulesConfig } from '@/eslint/shared/restricted.ts'\n\n// types ======================================================================\n\n/**\n * Configuration options for the environment preset 'env.browser'.\n */\nexport interface EnvBrowserOptions extends EnvRestrictedOptions { }\n\n// constants ==================================================================\n\n/**\n * Global builtin symbols that are confusing or deprecated.\n */\nconst CONFUSING_BUILTIN_GLOBALS: readonly string[] = [\n 'constructor',\n 'escape',\n 'eval',\n 'hasOwnProperty',\n 'isPrototypeOf',\n 'origin',\n 'propertyIsEnumerable',\n 'toLocaleString',\n 'toString',\n 'unescape',\n 'valueOf',\n]\n\n/**\n * Global browser classes that may conflict with custom application classes.\n * For disambiguation, custom classes must be imported, and global browser\n * classes must be used with their fully qualified name.\n */\nconst AMBIGUOUS_BROWSER_TYPES: readonly string[] = [\n 'Position',\n 'Point',\n 'Size',\n 'Range',\n]\n\n/**\n * Properties of global objects to be banned in all browser modules.\n */\nconst RESTRICTED_PROPERTIES: EnvRestrictedProperty[] = []\n\n/**\n * Syntax constructs to be banned in all browser modules.\n */\nconst RESTRICTED_SYNTAX: EnvRestrictedSyntax[] = [\n { selector: 'ExportNamedDeclaration > TSEnumDeclaration[const=true]', message: 'Do not export const enums.' },\n]\n\n// initialization =============================================================\n\n/**\n * All supported global browser symbols intended to be used without fully\n * qualified name (e.g. `HTMLElement` instead of `window.HTMLElement`).\n * A few confusing globals will be filtered though, especially symbols with\n * common names (e.g. `name`, `event`, etc.) to be able to catch missing or\n * misspelled variables or parameter names.\n */\nconst BROWSER_GLOBALS: Record<string, 'readonly'> = {}\n\n// Add all builtin ES globals.\nfor (const name of Object.keys(JAVASCRIPT_GLOBALS.builtin)) {\n BROWSER_GLOBALS[name] = 'readonly'\n}\n\n// Add browser globals (skip writable properties, e.g. window event handlers).\nfor (const [name, writable] of Object.entries(JAVASCRIPT_GLOBALS.browser)) {\n if (!writable) BROWSER_GLOBALS[name] = 'readonly'\n}\n\n// Remove commonly known confusing or deprecated builtin globals.\nfor (const name of CONFUSING_BUILTIN_GLOBALS) {\n delete BROWSER_GLOBALS[name]\n}\n\n// Remove commonly known confusing browser globals (e.g. `name`, `event`).\nfor (const name of CONFUSING_BROWSER_GLOBALS) {\n delete BROWSER_GLOBALS[name]\n}\n\n// Create the configuration list for rule 'no-restricted-globals'.\nconst RESTRICTED_GLOBALS: EnvRestrictedName[] = AMBIGUOUS_BROWSER_TYPES.map(name => {\n const message = `Import custom type '${name}', or use 'globalThis.${name}' for disambiguation.`\n return { name, message }\n})\n\n// functions ==================================================================\n\n/**\n * Creates configuration objects with global symbols and linter rules for for\n * browser modules.\n *\n * Wraps the following packages:\n * - `globals`\n * - `confusing-browser-globals`\n * - `eslint-plugin-no-unsanitized`\n *\n * @param envOptions\n * Configuration options for the environment.\n *\n * @returns\n * The configuration entries to be added to the resulting configuration array.\n */\nexport default function browser(envOptions: EnvBrowserOptions): ConfigArg {\n\n return [\n\n // register global symbols used in browser scripts\n createConfig('env.browser.globals', envOptions, {\n languageOptions: {\n globals: BROWSER_GLOBALS,\n },\n }),\n\n // generate the 'no-restricted-?' rules according to passed configuration\n restrictedRulesConfig('env.browser.restricted', envOptions, {\n globals: RESTRICTED_GLOBALS,\n properties: RESTRICTED_PROPERTIES,\n syntax: RESTRICTED_SYNTAX,\n }),\n\n // register rule implementations and recommended rules\n createConfig('env.browser.sanitized', envOptions, sanitizedPlugin.configs.recommended),\n\n // custom rules\n customRules('env.browser.rules', envOptions),\n ]\n}\n","\nimport extendedPlugin from 'eslint-plugin-jest-extended'\nimport jestDomPlugin from 'eslint-plugin-jest-dom'\nimport testingLibraryPlugin from 'eslint-plugin-testing-library'\n\nimport type { ConfigArg, EnvBaseOptions } from './env-utils.ts'\nimport { createConfig, customRules } from './env-utils.ts'\n\n// types ======================================================================\n\n/**\n * Shared options for environment presets for unit tests.\n */\nexport interface EnvUnitTestOptions extends EnvBaseOptions {\n\n /**\n * Specifies whether to include `eslint-plugin-jest-extended`. Should only be\n * used, if the package `jest-extended` has been installed in the project.\n *\n * @default false\n */\n jestExtended?: boolean\n\n /**\n * Specifies whether to include `eslint-plugin-jest-dom`. Should only be\n * used, if the package `@testing-library/jest-dom` has been installed in the\n * project.\n *\n * @default false\n */\n jestDom?: boolean\n\n /**\n * Specifies the recommended rule set of `eslint-plugin-testing-library` to\n * be included.\n */\n testingLib?: 'angular' | 'dom' | 'marko' | 'react' | 'vue'\n}\n\n// functions ==================================================================\n\n/**\n * Conditionally creates configuration entries for the ESLint plugins\n * `eslint-plugin-jest-dom` and `eslint-plugin-testing-library`.\n *\n * @param baseName\n * The base name for all configuration entries.\n *\n * @param envOptions\n * The configuration options for the unit test environment.\n *\n * @returns\n * The resulting configuration entries.\n */\nexport function createUnitTestPluginConfigs(baseName: string, envOptions: EnvUnitTestOptions): ConfigArg {\n\n return [\n\n // do not require strict documentation in unit tests\n customRules(`${baseName}.jsdoc`, envOptions, {\n 'jsdoc/require-jsdoc': 'off',\n 'jsdoc/require-param': 'off',\n }),\n\n // 'jest-extended' plugin (config 'flat/recommended' is empty)\n envOptions.jestExtended && createConfig(`${baseName}.extended`, envOptions, extendedPlugin.configs['flat/all']),\n\n // 'jest-dom' plugin\n envOptions.jestDom && createConfig(`${baseName}.jest-dom`, envOptions, jestDomPlugin.configs['flat/recommended'], {\n 'jest-dom/prefer-to-have-class': 'off', // TODO: crashes with ESLint v10 (dead project: https://github.com/testing-library/eslint-plugin-jest-dom/pull/415)\n }),\n\n // 'testing-library' plugin\n envOptions.testingLib && createConfig(`${baseName}.testing-library`, envOptions, {\n // register rule implementations of the plugins\n plugins: {\n 'testing-library': testingLibraryPlugin,\n },\n // recommended rules\n rules: {\n ...testingLibraryPlugin.configs[`flat/${envOptions.testingLib}`].rules,\n 'testing-library/no-node-access': ['error', { allowContainerFirstChild: true }],\n 'testing-library/prefer-user-event-setup': 'error',\n },\n }),\n ]\n}\n","\nimport jestPlugin from 'eslint-plugin-jest'\n\nimport { type ConfigArg, JS_GLOB, createConfig, customRules } from '@/eslint/shared/env-utils.ts'\nimport { type EnvUnitTestOptions, createUnitTestPluginConfigs } from '@/eslint/shared/unittest.ts'\n\n// types ======================================================================\n\n/**\n * Configuration options for the environment preset 'env.jest'.\n */\nexport interface EnvJestOptions extends EnvUnitTestOptions { }\n\n// functions ==================================================================\n\n/**\n * Creates configuration objects with global symbols and linter rules for unit\n * tests using Jest.\n *\n * Wraps the following packages:\n * - `eslint-plugin-jest`\n * - `eslint-plugin-jest-extended`\n * - `eslint-plugin-jest-dom`\n * - `eslint-plugin-testing-library`\n *\n * @param envOptions\n * Configuration options for the environment.\n *\n * @returns\n * The configuration entries to be added to the resulting configuration array.\n */\nexport default function jest(envOptions: EnvJestOptions): ConfigArg {\n\n return [\n\n // register rule implementations, globals, and recommended rules\n createConfig('env.jest.recommended', envOptions, jestPlugin.configs['flat/recommended']),\n\n // add recommended stylistic rules\n createConfig('env.jest.stylistic', envOptions, jestPlugin.configs['flat/style']),\n\n // 'jest-dom' and 'testing-library' plugin\n createUnitTestPluginConfigs('env.jest', envOptions),\n\n // custom rules\n customRules('env.jest.rules', envOptions, {\n // 'jest' plugin\n 'jest/consistent-test-it': ['error', { fn: 'it' }],\n 'jest/expect-expect': ['error', { assertFunctionNames: ['expect*'] }],\n 'jest/no-commented-out-tests': 'error',\n 'jest/no-conditional-expect': 'off',\n 'jest/no-confusing-set-timeout': 'error',\n 'jest/no-duplicate-hooks': 'error',\n 'jest/no-unneeded-async-expect-function': 'error',\n 'jest/no-test-return-statement': 'error',\n 'jest/prefer-comparison-matcher': 'error',\n 'jest/prefer-equality-matcher': 'error',\n 'jest/prefer-expect-resolves': 'error',\n 'jest/prefer-hooks-on-top': 'error',\n 'jest/prefer-jest-mocked': 'error',\n 'jest/prefer-lowercase-title': 'error',\n 'jest/prefer-mock-promise-shorthand': 'error',\n 'jest/prefer-mock-return-shorthand': 'error',\n 'jest/prefer-spy-on': 'error',\n 'jest/prefer-todo': 'error',\n 'jest/require-top-level-describe': 'error',\n }),\n\n // enable type-aware rules for TS files\n createConfig('env.jest.typescript', envOptions, {\n ignores: JS_GLOB,\n rules: {\n 'jest/no-error-equal': 'error',\n 'jest/no-unnecessary-assertion': 'error',\n 'jest/unbound-method': 'error',\n '@typescript-eslint/unbound-method': 'off', // replaced by 'jest/unbound-method'\n },\n }),\n ]\n}\n","\nimport vitestPlugin from '@vitest/eslint-plugin'\n\nimport { type ConfigArg, JS_GLOB, createConfig, customRules } from '@/eslint/shared/env-utils.ts'\nimport { type EnvUnitTestOptions, createUnitTestPluginConfigs } from '@/eslint/shared/unittest.ts'\n\n// types ======================================================================\n\n/**\n * Configuration options for the environment preset 'env.vitest'.\n */\nexport interface EnvVitestOptions extends EnvUnitTestOptions { }\n\n// functions ==================================================================\n\n/**\n * Creates configuration objects with global symbols and linter rules for unit\n * tests using Vitest.\n *\n * Wraps the following packages:\n * - `eslint-plugin-vitest`\n * - `eslint-plugin-jest-extended`\n * - `eslint-plugin-jest-dom`\n * - `eslint-plugin-testing-library`\n *\n * @param envOptions\n * Configuration options for the environment.\n *\n * @returns\n * The configuration entries to be added to the resulting configuration array.\n */\nexport default function vitest(envOptions: EnvVitestOptions): ConfigArg {\n\n return [\n\n // 'vitest' plugin\n createConfig('env.vitest.recommended', envOptions, {\n // register rule implementations of the plugins\n plugins: {\n vitest: vitestPlugin,\n },\n // register global symbols of Vitest\n languageOptions: {\n globals: vitestPlugin.environments.env.globals,\n },\n // recommended rules\n rules: vitestPlugin.configs.recommended.rules,\n }),\n\n // 'jest-dom' and 'testing-library' plugin\n createUnitTestPluginConfigs('env.vitest', envOptions),\n\n // allow to add type-checking expectations in tests\n createConfig('env.vitest.type-check', envOptions, {\n ignores: JS_GLOB,\n settings: {\n vitest: {\n typecheck: true,\n },\n },\n }),\n\n // custom rules\n customRules('env.vitest.rules', envOptions, {\n // 'vitest' plugin\n 'vitest/consistent-test-it': 'error',\n 'vitest/expect-expect': ['error', { assertFunctionNames: ['expect*'] }],\n 'vitest/no-alias-methods': 'error',\n 'vitest/no-disabled-tests': 'warn',\n 'vitest/no-duplicate-hooks': 'error',\n 'vitest/no-focused-tests': 'error',\n 'vitest/no-standalone-expect': 'error',\n 'vitest/no-test-prefixes': 'error',\n 'vitest/no-test-return-statement': 'error',\n 'vitest/prefer-comparison-matcher': 'error',\n 'vitest/prefer-each': 'error',\n 'vitest/prefer-equality-matcher': 'error',\n 'vitest/prefer-expect-resolves': 'error',\n 'vitest/prefer-hooks-in-order': 'error',\n 'vitest/prefer-hooks-on-top': 'error',\n 'vitest/prefer-import-in-mock': 'error',\n 'vitest/prefer-mock-promise-shorthand': 'error',\n 'vitest/prefer-mock-return-shorthand': 'error',\n 'vitest/prefer-spy-on': 'error',\n 'vitest/prefer-strict-equal': 'error',\n 'vitest/prefer-to-be': 'error',\n 'vitest/prefer-to-contain': 'error',\n 'vitest/prefer-to-have-length': 'error',\n 'vitest/prefer-vi-mocked': 'error',\n 'vitest/require-top-level-describe': 'error',\n 'vitest/valid-expect-in-promise': 'error',\n }),\n ]\n}\n","\nimport codeceptPlugin from 'eslint-plugin-codeceptjs'\nimport chaiExpectPlugin from 'eslint-plugin-chai-expect'\n\nimport type { ConfigArg, EnvBaseOptions } from '@/eslint/shared/env-utils.ts'\nimport { createConfig, customRules } from '@/eslint/shared/env-utils.ts'\n\n// types ======================================================================\n\n/**\n * Configuration options for the environment preset 'env.codecept'.\n */\nexport interface EnvCodeceptOptions extends EnvBaseOptions { }\n\n// functions ==================================================================\n\n/**\n * Creates configuration objects with global symbols and linter rules for E2E\n * tests using CodeceptJS.\n *\n * Wraps the following packages:\n * - `eslint-plugin-codeceptjs`\n * - `eslint-plugin-chai-expect`\n *\n * @param envOptions\n * Configuration options for the environment.\n *\n * @returns\n * The configuration entries to be added to the resulting configuration array.\n */\nexport default function codecept(envOptions: EnvCodeceptOptions): ConfigArg {\n\n return [\n\n // 'codecept' plugin\n createConfig('env.codecept.plugin', envOptions, {\n // register rule implementations of the plugins\n plugins: {\n codeceptjs: codeceptPlugin,\n },\n // register global symbols of CodeceptJS\n languageOptions: {\n globals: codeceptPlugin.environments.codeceptjs.globals,\n },\n // recommended rules\n rules: codeceptPlugin.configs.recommended.rules,\n }),\n\n // 'chai-expect' plugin\n createConfig('env.codecept.chai-expect', envOptions, chaiExpectPlugin.configs['recommended-flat']),\n\n // custom rules\n customRules('env.codecept.rules', envOptions, {\n 'new-cap': ['error', {\n capIsNewExceptions: ['After', 'AfterSuite', 'Before', 'BeforeSuite', 'Feature', 'Scenario'],\n }],\n 'no-restricted-properties': ['warn', { object: 'Scenario', property: 'todo', message: 'Unexpected unimplemented test.' }],\n 'codeceptjs/no-skipped-tests': 'warn',\n // do not require strict documentation in e2e tests\n 'jsdoc/require-jsdoc': 'off',\n 'jsdoc/require-param': 'off',\n }),\n ]\n}\n","\nimport { posix, sep, dirname, extname } from 'node:path'\nimport { lstatSync } from 'node:fs'\nimport { createRequire } from 'node:module'\n\nimport pm, { type Glob } from 'picomatch'\nimport * as find from 'empathic/find'\n\nimport type { JSONSchema, TSESTree, TSESLint } from '@typescript-eslint/utils'\nimport { AST_NODE_TYPES as NodeType } from '@typescript-eslint/utils'\n\n// types ======================================================================\n\nexport type OptASTNode = TSESTree.Node | null | undefined\n\n/**\n * Shared settings used by multiple rules.\n */\nexport interface SharedRuleSettings {\n\n /**\n * Maps all alias prefixes to actual paths in the project.\n */\n alias?: Record<string, string>\n}\n\n// ----------------------------------------------------------------------------\n\nexport type ImportExportNode =\n | TSESTree.ImportDeclaration\n | TSESTree.ImportExpression\n | TSESTree.ExportAllDeclaration\n | TSESTree.ExportNamedDeclaration\n | TSESTree.TSExternalModuleReference\n\n// constants ==================================================================\n\nconst FILE_EXTENSIONS = ['js', 'ts', 'd.ts']\n\nconst CONFIG_FILES: string[] = [\n 'eslint.config.js',\n 'eslint.config.mjs',\n 'eslint.config.cjs',\n 'eslint.config.ts',\n 'eslint.config.mts',\n 'eslint.config.cts',\n]\n\n// Schema =====================================================================\n\n/**\n * Helper functions to build a JSON schema for custom ESLint rules.\n */\nexport const Schema = {\n\n boolean(): JSONSchema.JSONSchema4BooleanSchema {\n return { type: 'boolean' }\n },\n\n string(): JSONSchema.JSONSchema4StringSchema {\n return { type: 'string' }\n },\n\n stringNE(): JSONSchema.JSONSchema4StringSchema {\n return { type: 'string', minLength: 1 }\n },\n\n array(items: JSONSchema.JSONSchema4): JSONSchema.JSONSchema4ArraySchema {\n return { type: 'array', items, uniqueItems: true }\n },\n\n maybeArray(items: JSONSchema.JSONSchema4): JSONSchema.JSONSchema4OneOfSchema {\n return { oneOf: [items, Schema.array(items)] }\n },\n\n dictionary(properties: JSONSchema.JSONSchema4): JSONSchema.JSONSchema4ObjectSchema {\n return { type: 'object', additionalProperties: properties }\n },\n\n options(properties: Record<string, JSONSchema.JSONSchema4>, required?: boolean | string[]): JSONSchema.JSONSchema4ObjectSchema {\n return { type: 'object', properties, required, additionalProperties: false }\n },\n}\n\n// functions ==================================================================\n\n/**\n * Returns whether the passed AST node is an `Identifier `node.\n *\n * @param node\n * The AST node to be checked.\n *\n * @returns\n * Whether the passed AST node is an `Identifier` node.\n */\nexport function isIdentifier(node: OptASTNode): node is TSESTree.Identifier {\n return node?.type === NodeType.Identifier\n}\n\n/**\n * Returns whether the passed AST node is a `Literal` node.\n *\n * @param node\n * The AST node to be checked.\n *\n * @returns\n * Whether the passed AST node is a `Literal` node.\n */\nexport function isLiteral(node: OptASTNode): node is TSESTree.Literal {\n return node?.type === NodeType.Literal\n}\n\n/**\n * Returns whether the passed AST node is a `Literal` node with a specific\n * constant value.\n *\n * @param node\n * The AST node to be checked.\n *\n * @param value\n * The expected literal value.\n *\n * @returns\n * Whether the passed AST node is a `Literal` node with a constant value.\n */\nexport function isLiteralValue(node: TSESTree.Node, value: unknown): node is TSESTree.Literal {\n return isLiteral(node) && (node.value === value)\n}\n\n/**\n * Returns whether the passed AST node is an `AssignmentExpression` node.\n *\n * @param node\n * The AST node to be checked.\n *\n * @returns\n * Whether the passed AST node is an `AssignmentExpression` node.\n */\nexport function isAssignmentExpression(node: OptASTNode): node is TSESTree.AssignmentExpression {\n return node?.type === NodeType.AssignmentExpression\n}\n\n/**\n * Returns whether the passed AST node is a `MemberExpression` node.\n *\n * @param node\n * The AST node to be checked.\n *\n * @returns\n * Whether the passed AST node is a `MemberExpression` node.\n */\nexport function isMemberExpression(node: OptASTNode): node is TSESTree.MemberExpression {\n return node?.type === NodeType.MemberExpression\n}\n\n/**\n * Returns a passed array unmodified, converts the value `undefined` to an\n * empty array, and converts all other values to an array with one element.\n *\n * @template T\n * The type of the array elements.\n *\n * @param value\n * Any value to be converted to an array.\n *\n * @returns\n * An array containing the value, unless the value is already an array.\n */\nexport function makeArray<T>(value: T | T[] | undefined): T[] {\n return Array.isArray(value) ? value : (value === undefined) ? [] : [value]\n}\n\n/**\n * Converts a Windows file path to a Posix file path.\n *\n * @param path\n * The file path to be normalized to Posix format.\n *\n * @returns\n * The normalized Posix file path.\n */\nexport function toPosixPath(path: string): string {\n return path.replaceAll(sep, posix.sep)\n}\n\n/**\n * Returns whether the passed path refers to an existing file.\n *\n * @param path\n * The path to be checked.\n *\n * @returns\n * Whether the passed path refers to an existing file (returns `false` for\n * existing directories).\n */\nexport function isFile(path: string): boolean {\n try {\n return lstatSync(path).isFile()\n } catch {\n return false\n }\n}\n\n// class ImportNodeWrapper ====================================================\n\n/**\n * A wrapper for an `import` statement containing a string literal node with a\n * module name, and the resulting extracted module name.\n */\nexport class ImportNodeWrapper {\n\n /** The string literal node containing the name of the imported module. */\n readonly sourceNode: TSESTree.StringLiteral\n\n /** The original name of the imported module (with alias key). */\n readonly moduleName: string\n\n // constructor ------------------------------------------------------------\n\n constructor(node: TSESTree.StringLiteral) {\n this.sourceNode = node\n // strip URL query strings from module name\n this.moduleName = node.value.replace(/\\?.*$/, '')\n }\n\n // public methods ---------------------------------------------------------\n\n /**\n * Returns whether the name of the imported module matches the specified glob\n * patterns.\n *\n * @param patterns\n * The glob patterns to be matched against the module name.\n *\n * @returns\n * Whether the name of the wrapped module matches at least one glob\n * pattern.\n */\n matchModuleName(patterns: Glob): boolean {\n return pm.isMatch(this.moduleName, patterns)\n }\n}\n\n// class ProjectContext =======================================================\n\n/**\n * A custom context helper for the linter rules of the preset environment\n * 'env.project'.\n *\n * @param context\n * The rule context of the module currently linted.\n */\nexport class ProjectContext {\n\n /** Maps alias keys to alias paths. */\n readonly #aliasMap: Map<string, string>\n\n /** Root directory containing the linter configuration file. */\n readonly #rootDir: string\n\n /** Absolute path to the linter configuration file. */\n readonly #configPath: string\n\n /** The name of the linted module (with alias prefix if available). */\n readonly #moduleName: string\n\n /** Resolver for npm packages. */\n #requireModule: NodeJS.Require | undefined\n\n // constructor ------------------------------------------------------------\n\n constructor(context: Readonly<TSESLint.RuleContext<any, any>>) {\n\n // convert 'alias' option to map\n const sharedSettings = context.settings['env-project'] as SharedRuleSettings | undefined\n this.#aliasMap = new Map(Object.entries(sharedSettings?.alias ?? {}))\n\n // resolve root directory\n const configPath = find.any(CONFIG_FILES)\n if (!configPath) {\n throw new Error('cannot find configuration file')\n }\n const rootDir = toPosixPath(dirname(configPath))\n const fileName = toPosixPath(context.filename)\n if (!fileName.startsWith(rootDir + '/')) {\n throw new Error('invalid root directory')\n }\n this.#rootDir = rootDir\n this.#configPath = configPath\n\n // path of current module (slice rootDir with '/' from start, and extension with '.' from end)\n const fileExt = extname(fileName)\n const selfModulePath = fileName.slice(rootDir.length + 1, -fileExt.length)\n if (!selfModulePath) {\n throw new Error('invalid own module path')\n }\n\n // replace alias path with alias key\n this.#moduleName = selfModulePath\n for (const [aliasKey, aliasPath] of this.#aliasMap) {\n if (selfModulePath.startsWith(aliasPath + '/')) {\n this.#moduleName = aliasKey + '/' + selfModulePath.slice(aliasPath.length + 1)\n break\n }\n }\n }\n\n // public methods ---------------------------------------------------------\n\n /**\n * Extracts the source node and module name of an import/export statement\n * node, or a dynamic import expression node.\n *\n * @param node\n * The import/export statement node, or dynamic import expression node.\n *\n * @returns\n * The string literal node containing the module name, and the resulting\n * extracted module name.\n */\n resolveImportNode(node: ImportExportNode): ImportNodeWrapper | undefined {\n\n // TSExternalModuleReference: module name in property 'expression', otherwise 'source'\n const sourceNodeRaw = (node.type === NodeType.TSExternalModuleReference) ? node.expression : node.source\n\n // module name is expected to be a string literal\n const isStringLiteral = (sourceNodeRaw?.type === NodeType.Literal) && (typeof sourceNodeRaw.value === 'string')\n return isStringLiteral ? new ImportNodeWrapper(sourceNodeRaw) : undefined\n }\n\n /**\n * Extracts an existing alias key, and resolves the module path of a module\n * name.\n *\n * @param moduleName\n * The module name to extract an alias key from.\n *\n * @returns\n * A pair containing the alias key (empty string if no alias found), and the\n * resolved module path (passed module name if no alias found).\n */\n resolveAlias(moduleName: string): [string, string] {\n const [key, ...rest] = moduleName.split('/')\n const aliasPath = (key && rest[0]) ? this.#aliasMap.get(key) : undefined\n const aliasKey = aliasPath ? key : ''\n const modulePath = aliasPath ? posix.join(aliasPath, ...rest) : moduleName\n return [aliasKey, modulePath]\n }\n\n /**\n * Returns whether the name of the module currently linted matches the\n * specified glob patterns.\n *\n * @param patterns\n * The glob patterns to be matched against the current module name.\n *\n * @returns\n * Whether the current module name matches at least one glob pattern.\n */\n matchModuleName(patterns: Glob): boolean {\n return pm.isMatch(this.#moduleName, patterns)\n }\n\n /**\n * Returns whether a source file exists for the specified module.\n *\n * @param modulePath\n * The resolved module path (alias key replaced with path).\n *\n * @returns\n * Whether a source file exists for the specified module.\n */\n fileExists(modulePath: string): boolean {\n // check modules with explicit extension\n const resolvedPath = posix.join(this.#rootDir, modulePath)\n if (extname(modulePath)) return isFile(resolvedPath)\n // search for a file with a known extension\n return FILE_EXTENSIONS.some(ext => isFile(resolvedPath + '.' + ext))\n }\n\n /**\n * Returns whether the passed module name is an installed npm package.\n *\n * @param moduleName\n * The module name to be checked.\n *\n * @returns\n * Whether the passed module name is an installed npm package.\n */\n packageExists(moduleName: string): boolean {\n this.#requireModule ??= createRequire(this.#configPath)\n try {\n this.#requireModule.resolve(moduleName)\n return true\n } catch {\n return false\n }\n }\n}\n","\nimport { AST_NODE_TYPES as NodeType } from '@typescript-eslint/utils'\nimport type { RuleFunction } from '@eslint-react/kit'\n\nimport { isLiteralValue } from '@/eslint/shared/rule-utils'\n\n// functions ==================================================================\n\n/**\n * Enforce shorthand notation for boolean JSX attributes.\n *\n * @returns\n * The rule implementation.\n */\nexport default function jsxShorthandBoolean(): RuleFunction {\n\n // @eslint-react plugin injects the toolkit\n return (context, toolkit) => ({\n JSXAttribute(node) {\n\n // check attribute expressions only\n const value = node.value\n if (value?.type !== NodeType.JSXExpressionContainer) return\n\n // unwrap expression root node from TypeScript type augmentations\n const expression = toolkit.ast.unwrap(value.expression)\n\n // trigger for literal value `true` only\n if (isLiteralValue(expression, true)) {\n context.report({\n node,\n message: 'Omit the value for boolean attributes.',\n fix: fixer => fixer.removeRange([node.name.range[1], value.range[1]]),\n })\n }\n },\n })\n}\n","\nimport { type RuleFunction, merge } from '@eslint-react/kit'\nimport { isIdentifier, isAssignmentExpression, isMemberExpression } from '@/eslint/shared/rule-utils'\n\n// functions ==================================================================\n\n/**\n * Enforce destructuring assignment for component props.\n *\n * @returns\n * The rule implementation.\n */\nexport default function preferDestructuringAssignment(): RuleFunction {\n\n // @eslint-react plugin injects the toolkit\n return (context, toolkit) => {\n\n // collect all function components in the source file while traversing\n const components = toolkit.collect.components(context)\n\n return merge(components.visitor, {\n 'Program:exit'(program) {\n\n // process all collected function components\n for (const component of components.query.all(program)) {\n\n // inspect the first function parameter (skip direct destructuring)\n const param = component.node.params[0]\n if (!isIdentifier(param)) continue\n\n // find the scope of the parameter containing all access references\n const scope = context.sourceCode.getScope(component.node)\n const variable = scope.variables.find(v => v.name === param.name)\n if (!variable?.references) continue\n\n // check all access references\n for (const reference of variable.references) {\n\n // must be part of a member expression\n const parent = reference.identifier.parent\n if (!isMemberExpression(parent)) continue\n\n // ignore assignments (will be caught by 'immutable' rule)\n if (isAssignmentExpression(parent.parent) && (parent === parent.parent.left)) continue\n\n context.report({\n node: parent,\n message: 'Use destructuring assignment for component props.',\n })\n }\n }\n },\n })\n }\n}\n","\nimport reactPlugin from '@eslint-react/eslint-plugin'\nimport reactKit from '@eslint-react/kit'\nimport reactHooksPlugin from 'eslint-plugin-react-hooks'\nimport { reactRefresh } from 'eslint-plugin-react-refresh'\nimport jsxA11yPlugin from 'eslint-plugin-jsx-a11y'\nimport { parser } from 'typescript-eslint'\n\nimport type { ConfigArg, EnvBaseOptions } from '@/eslint/shared/env-utils.ts'\nimport { createConfig, customRules, convertRuleWarningsToErrors, mergeSettings } from '@/eslint/shared/env-utils.ts'\n\nimport jsxShorthandBoolean from '@/eslint/rules/react/jsxShorthandBoolean'\nimport preferDestructuringAssignment from '@/eslint/rules/react/preferDestructuringAssignment'\n\n// types ======================================================================\n\n/**\n * Configuration options for the environment preset 'env.react'.\n */\nexport interface EnvReactOptions extends EnvBaseOptions {\n\n /**\n * Additional hooks that will be treated as state hooks, like 'useState'.\n *\n * Will be used by the rule '@eslint-react/set-state-in-effect'.\n */\n stateHooks?: readonly string[]\n\n /**\n * Additional hooks that will be treated as hooks returning a React ref, like\n * 'useRef'.\n *\n * Will be used by rules that check hooks returning React refs like\n * '@eslint-react/naming-convention-ref-name'.\n */\n refHooks?: readonly string[]\n\n /**\n * Additional hooks that will be treated as effect hooks, like 'useEffect'.\n *\n * Will be used by the rule '@eslint-react/rules-of-hooks'.\n */\n effectHooks?: readonly string[]\n}\n\n// functions ==================================================================\n\n/**\n * Creates configuration objects with linter rules for ReactJS.\n *\n * Wraps the following packages:\n * - `@eslint-react/eslint-plugin`\n * - `eslint-plugin-react-hooks`\n * - `eslint-plugin-react-refresh`\n * - `eslint-plugin-jsx-a11y`\n *\n * @param envOptions\n * Configuration options for the environment.\n *\n * @returns\n * The configuration entries to be added to the resulting configuration array.\n */\nexport default function react(envOptions: EnvReactOptions): ConfigArg {\n\n const reactConfig = reactPlugin.configs['strict-type-checked']\n\n // extend shared plugin settings\n const settings = { ...reactConfig.settings }\n if (envOptions.stateHooks?.length) {\n const additionalStateHooks = `/^(${envOptions.stateHooks.join('|')})$/`\n mergeSettings(settings, 'react-x', { additionalStateHooks })\n }\n if (envOptions.refHooks?.length) {\n const additionalRefHooks = `/^(${envOptions.refHooks.join('|')})$/`\n mergeSettings(settings, 'react-x', { additionalRefHooks })\n }\n if (envOptions.effectHooks?.length) {\n const additionalEffectHooks = `/^(${envOptions.effectHooks.join('|')})$/`\n mergeSettings(settings, 'react-x', { additionalEffectHooks })\n }\n\n return [\n\n // configure 'react' plugin for all source files (JSX and TSX)\n createConfig('env.react.recommended', envOptions, {\n // auto-detect installed React version\n languageOptions: {\n parser,\n parserOptions: { projectService: true },\n },\n // register rule implementations and language settings, raise all recommended rules to 'error' level\n ...convertRuleWarningsToErrors(reactConfig),\n // additional settings\n settings,\n }, {\n // custom overrides\n '@eslint-react/dom-no-unknown-property': 'error',\n '@eslint-react/jsx-no-leaked-dollar': 'error',\n '@eslint-react/jsx-no-useless-fragment': ['error', { allowEmptyFragment: true }],\n '@eslint-react/naming-convention-context-name': 'error',\n '@eslint-react/no-missing-component-display-name': 'error',\n '@eslint-react/no-missing-context-display-name': 'error',\n '@eslint-react/refs': 'error',\n }),\n\n createConfig('env.react.recommended', envOptions, {\n extends: [\n reactKit()\n .use(jsxShorthandBoolean)\n .use(preferDestructuringAssignment)\n .getConfig(),\n ],\n }),\n\n // 'react-hooks' plugin and recommended rules, raise all recommended rules to 'error' level\n createConfig('env.react.react-hooks', envOptions, convertRuleWarningsToErrors(reactHooksPlugin.configs.flat.recommended), {\n // disable rules that are also implemented in @eslint-react\n 'react-hooks/exhaustive-deps': 'off',\n 'react-hooks/refs': 'off',\n 'react-hooks/rules-of-hooks': 'off',\n 'react-hooks/set-state-in-effect': 'off',\n 'react-hooks/set-state-in-render': 'off',\n }),\n\n // 'react-refresh' plugin\n createConfig('env.react.react-refresh', envOptions, reactRefresh.configs.vite()),\n\n // 'jsx-a11y' plugin\n createConfig('env.react.jsx-a11y', envOptions, jsxA11yPlugin.flatConfigs.recommended),\n\n // custom rules\n customRules('env.react.rules', envOptions),\n ]\n}\n","\nimport eslintPlugin from 'eslint-plugin-eslint-plugin'\n\nimport type { ConfigArg, EnvBaseOptions } from '@/eslint/shared/env-utils.ts'\nimport { createConfig, customRules } from '@/eslint/shared/env-utils.ts'\n\n// types ======================================================================\n\n/**\n * Configuration options for the environment preset 'env.eslint'.\n */\nexport interface EnvEslintOptions extends EnvBaseOptions { }\n\n// exports ====================================================================\n\n/**\n * Adds linter rules for ESLint plugin implementations.\n *\n * Wraps the following packages:\n * - `eslint-plugin-eslint-plugin`\n *\n * @param envOptions\n * Configuration options for the environment.\n *\n * @returns\n * The configuration entries to be added to the resulting configuration array.\n */\nexport default function eslint(envOptions: EnvEslintOptions): ConfigArg {\n\n return [\n\n // register rule implementations and recommended rules\n createConfig('env.eslint.recommended', envOptions, eslintPlugin.configs['rules-recommended']),\n\n // custom rules\n customRules('env.eslint.rules', envOptions, {\n 'eslint-plugin/no-property-in-node': 'error',\n 'eslint-plugin/prefer-placeholders': 'error',\n 'eslint-plugin/prefer-replace-text': 'error',\n 'eslint-plugin/require-meta-docs-description': 'error',\n }),\n ]\n}\n","\nimport { AST_NODE_TYPES as NodeType, ESLintUtils } from '@typescript-eslint/utils'\n\nimport type { ImportExportNode } from '@/eslint/shared/rule-utils.ts'\nimport { Schema, ProjectContext } from '@/eslint/shared/rule-utils.ts'\n\n// types ======================================================================\n\n/**\n * Configuration for the rule 'env-project/no-invalid-modules'.\n */\nexport interface RuleNoInvalidModulesOptions {\n\n /**\n * Specifies glob patterns for external modules.\n */\n external?: string[]\n}\n\n// ----------------------------------------------------------------------------\n\ntype RuleOptions = [Required<RuleNoInvalidModulesOptions>]\ntype RuleMessageIds = 'SOURCE_FILE_NOT_FOUND'\n\n// exports ====================================================================\n\nexport default ESLintUtils.RuleCreator.withoutDocs<RuleOptions, RuleMessageIds>({\n\n meta: {\n type: 'problem',\n schema: [\n // single options object\n Schema.options({\n external: Schema.array(Schema.stringNE()),\n }),\n ],\n messages: {\n SOURCE_FILE_NOT_FOUND: 'Source file for `{{moduleName}}` not found.',\n },\n fixable: 'code',\n },\n\n defaultOptions: [{\n external: [],\n }],\n\n create(context, [options]) {\n\n // create the project context with aliases, root path, own module name, etc.\n const projectContext = new ProjectContext(context)\n\n return {\n 'ImportDeclaration, TSExternalModuleReference, ImportExpression, ExportAllDeclaration, ExportNamedDeclaration'(node: ImportExportNode) {\n\n // import/export statement must contain string literal\n const importWrapper = projectContext.resolveImportNode(node)\n if (!importWrapper) return\n\n // skip glob patterns in TypeScript type imports\n if ((node.type === NodeType.ImportDeclaration) && (node.importKind === 'type') && importWrapper.moduleName.includes('*')) {\n return\n }\n\n // accept known external module\n if (importWrapper.matchModuleName(options.external)) return\n\n // extract alias key, replace with alias path\n const [aliasKey, modulePath] = projectContext.resolveAlias(importWrapper.moduleName)\n\n // accept installed npm package\n if (!aliasKey && projectContext.packageExists(modulePath)) return\n\n // check existence of source file\n if (!projectContext.fileExists(modulePath)) {\n context.report({\n messageId: 'SOURCE_FILE_NOT_FOUND',\n node: importWrapper.sourceNode,\n data: { moduleName: importWrapper.moduleName },\n })\n }\n },\n }\n },\n})\n","\nimport { AST_NODE_TYPES as NodeType, ESLintUtils } from '@typescript-eslint/utils'\n\nimport type { ImportExportNode } from '@/eslint/shared/rule-utils.ts'\nimport { Schema, makeArray, ProjectContext } from '@/eslint/shared/rule-utils.ts'\n\n// types ======================================================================\n\n/**\n * Configuration for the rule 'env-project/no-invalid-hierarchy' to specify a\n * sub package inside a project.\n */\nexport interface RuleNoInvalidHierarchyPackage {\n\n /**\n * Glob patterns selecting all source files that are part of the package.\n */\n files: string[]\n\n /**\n * Specifies the names of all packages (keys of the `packages` dictionary)\n * this package depends on.\n */\n extends?: string | string[]\n\n /**\n * Set to `true` to mark an optional package that may be missing in an\n * installation. Such a package cannot be imported statically (with `import`\n * statement) from a non-optional package, but can only be loaded dynamically\n * at runtime (by calling `import()`). The rule will mark all static imports\n * of optional code as an error.\n *\n * @default false\n */\n optional?: boolean\n}\n\n// ----------------------------------------------------------------------------\n\nexport type RuleNoInvalidHierarchyOptions = Record<string, RuleNoInvalidHierarchyPackage>\n\n// ----------------------------------------------------------------------------\n\ntype RuleOptions = [RuleNoInvalidHierarchyOptions]\ntype RuleMessageIds = 'UNEXPECTED_OPTIONAL_STATIC' | 'INVALID_PACKAGE_HIERARCHY'\n\n// exports ====================================================================\n\nexport default ESLintUtils.RuleCreator.withoutDocs<RuleOptions, RuleMessageIds>({\n\n meta: {\n type: 'problem',\n schema: [\n // single options object\n Schema.dictionary(Schema.options({\n files: Schema.maybeArray(Schema.stringNE()),\n extends: Schema.maybeArray(Schema.stringNE()),\n optional: Schema.boolean(),\n }, ['files'])),\n ],\n messages: {\n UNEXPECTED_OPTIONAL_STATIC: 'Unexpected static import of optional package.',\n INVALID_PACKAGE_HIERARCHY: 'Low-level package cannot import modules from higher-level package.',\n },\n fixable: 'code',\n },\n\n defaultOptions: [{}],\n\n create(context, [options]) {\n\n // create the project context with aliases, root path, own module name, etc.\n const projectContext = new ProjectContext(context)\n\n /** @ignore */\n interface Package extends RuleNoInvalidHierarchyPackage {\n extends: string[]\n }\n\n // convert strings in record entries to arrays\n const hierarchyMap = new Map<string, Package>()\n for (const [key, settings] of Object.entries(options)) {\n hierarchyMap.set(key, {\n ...settings,\n extends: makeArray(settings.extends),\n })\n }\n\n // collect all globs for package members\n const packagesGlobs = Array.from(hierarchyMap.values(), settings => settings.files).flat()\n\n return {\n 'ImportDeclaration, TSExternalModuleReference, ImportExpression, ExportAllDeclaration, ExportNamedDeclaration'(node: ImportExportNode) {\n\n // import/export statement must contain string literal\n const importWrapper = projectContext.resolveImportNode(node)\n if (!importWrapper) return\n\n // check dependencies if the imported module is covered in the configuration\n if (!importWrapper.matchModuleName(packagesGlobs)) return\n\n // whether an invalid static import has been found ('as boolean' to workaround linter)\n let invalidStatic = false as boolean\n\n // recursively checks the imported module for dependency violations\n const checkDependencies = (settings: Package, root: boolean): boolean => {\n\n // only allow static imports from specified package, if it is not optional\n if (importWrapper.matchModuleName(settings.files)) {\n if (!root && (node.type !== NodeType.ImportExpression) && settings.optional) invalidStatic = true\n return true\n }\n\n // do not traverse into dependencies of optional modules\n if (!settings.extends.length || (!root && settings.optional)) {\n return false\n }\n\n // allow imports from any of the dependent packages\n return settings.extends.some(key => {\n const package2 = hierarchyMap.get(key)\n return !!package2 && checkDependencies(package2, false)\n })\n }\n\n // check dependencies of all configured packages (not for anonymous modules)\n let invalidDeps = false\n for (const settings of hierarchyMap.values()) {\n if (projectContext.matchModuleName(settings.files) && !checkDependencies(settings, true)) {\n invalidDeps = true\n break\n }\n }\n\n // report package hierarchy errors\n if (invalidStatic) {\n context.report({ messageId: 'UNEXPECTED_OPTIONAL_STATIC', node: importWrapper.sourceNode })\n } else if (invalidDeps) {\n context.report({ messageId: 'INVALID_PACKAGE_HIERARCHY', node: importWrapper.sourceNode })\n }\n },\n }\n },\n})\n","\nimport type { ConfigArg, EnvBaseOptions } from '@/eslint/shared/env-utils.ts'\nimport { createConfig, customRules } from '@/eslint/shared/env-utils.ts'\nimport type { SharedRuleSettings } from '@/eslint/shared/rule-utils.ts'\n\nimport noInvalidModules, { type RuleNoInvalidModulesOptions } from '@/eslint/rules/project/noInvalidModules.ts'\nimport noInvalidHierarchy, { type RuleNoInvalidHierarchyOptions } from '@/eslint/rules/project/noInvalidHierarchy.ts'\n\n// types ======================================================================\n\n/**\n * Configuration options for the environment preset 'env.project'.\n */\nexport interface EnvProjectOptions extends EnvBaseOptions {\n\n /**\n * Maps all alias prefixes to actual paths in the project.\n */\n alias?: SharedRuleSettings['alias']\n\n /**\n * Options to be passed to the rule 'env-project/no-invalid-modules'.\n */\n external?: RuleNoInvalidModulesOptions['external']\n\n /**\n * Options to be passed to the rule 'env-project/no-invalid-hierarchy'.\n */\n hierarchy?: RuleNoInvalidHierarchyOptions\n}\n\n// exports ====================================================================\n\n/**\n * Adds custom linter rules for checking project setup and module hierarchy.\n *\n * @param envOptions\n * Configuration options for the environment.\n *\n * @returns\n * The configuration entries to be added to the resulting configuration array.\n */\nexport default function project(envOptions: EnvProjectOptions): ConfigArg {\n\n return [\n\n // register rule implementations\n createConfig('env.project.plugin', envOptions, {\n plugins: {\n 'env-project': {\n rules: {\n 'no-invalid-modules': noInvalidModules,\n 'no-invalid-hierarchy': noInvalidHierarchy,\n },\n },\n },\n settings: {\n 'env-project': {\n alias: envOptions.alias,\n },\n },\n }),\n\n // custom rules\n customRules('env.project.rules', envOptions, {\n 'env-project/no-invalid-modules': ['error', { external: envOptions.external ?? [] }],\n 'env-project/no-invalid-hierarchy': envOptions.hierarchy ? ['error', envOptions.hierarchy] : 'off',\n }),\n ]\n}\n","\nimport type { ConfigArg, EnvBaseOptions } from '@/eslint/shared/env-utils.ts'\nimport { createConfig, customRules } from '@/eslint/shared/env-utils.ts'\n\n// types ======================================================================\n\n/**\n * Configuration options for the environment preset 'env.tsconfig'.\n */\nexport interface EnvTSConfigOptions extends EnvBaseOptions {\n\n /**\n * The path to the TypeScript project configuration file (`tsconfig.json`).\n */\n project: string\n}\n\n// functions ==================================================================\n\n/**\n * Creates configuration objects for TypeScript projects.\n *\n * @param envOptions\n * Configuration options for the environment.\n *\n * @returns\n * The configuration entries to be added to the resulting configuration array.\n */\nexport default function tsconfig(envOptions: EnvTSConfigOptions): ConfigArg {\n\n return [\n\n // path to project configuration file\n createConfig('env.tsconfig.project', envOptions, {\n languageOptions: {\n parserOptions: {\n projectService: false,\n project: envOptions.project,\n },\n },\n }),\n\n // custom rules\n customRules('env.tsconfig.rules', envOptions),\n ]\n}\n","\nimport * as babelParser from '@babel/eslint-parser'\n\nimport type { ConfigArg, EnvBaseOptions } from '@/eslint/shared/env-utils.ts'\nimport { TS_GLOB, createConfig, customRules } from '@/eslint/shared/env-utils.ts'\n\n// types ======================================================================\n\n/**\n * Configuration options for the environment preset 'env.decorators'.\n */\nexport interface EnvDecoratorsOptions extends EnvBaseOptions { }\n\n// functions ==================================================================\n\n/**\n * Adds support for native decorators in JavaScript source files.\n *\n * Wraps the following packages:\n * - `@babel/eslint-parser`\n * - `@babel/plugin-proposal-decorators`\n *\n * @param envOptions\n * Configuration options for the environment.\n *\n * @returns\n * The configuration entries to be added to the resulting configuration array.\n */\nexport default function decorators(envOptions: EnvBaseOptions): ConfigArg {\n\n return [\n\n createConfig('core.decorators.babel', envOptions, {\n ignores: TS_GLOB,\n languageOptions: {\n parser: babelParser,\n parserOptions: {\n requireConfigFile: false,\n babelOptions: {\n babelrc: false,\n configFile: false,\n parserOpts: { plugins: ['decorators'] },\n },\n },\n },\n }),\n\n customRules('core.decorators.rules', envOptions),\n ]\n}\n","\nimport type { ConfigObject, RulesConfig } from '@eslint/core'\nimport { defineConfig as defineEslintConfig, globalIgnores } from '@eslint/config-helpers'\n\nimport { flattenDeepArrays } from '@/utils/utils.ts'\nimport { PathResolver } from '@/utils/resolver.ts'\nimport type { Config, ConfigArg, LanguageOptions, LanguageConfig, PackagesOptions, PackagesConfig, StylisticOptions, StylisticConfig } from '@/eslint/shared/env-utils.ts'\nimport type { VueOptions } from '@/eslint/core/vue.ts'\n\nimport base from '@/eslint/core/base.ts'\nimport js from '@/eslint/core/js.ts'\nimport ts from '@/eslint/core/ts.ts'\nimport vue from '@/eslint/core/vue.ts'\nimport json from '@/eslint/core/json.ts'\nimport yaml from '@/eslint/core/yaml.ts'\nimport markdown from '@/eslint/core/markdown.ts'\nimport license from '@/eslint/core/license.ts'\nimport directives from '@/eslint/core/directives.ts'\nimport packages from '@/eslint/core/packages.ts'\nimport regexp from '@/eslint/core/regexp.ts'\nimport promises from '@/eslint/core/promises.ts'\nimport jsdoc from '@/eslint/core/jsdoc.ts'\nimport stylistic from '@/eslint/core/stylistic.ts'\n\nimport node from '@/eslint/env/node.ts'\nimport browser from '@/eslint/env/browser.ts'\nimport jest from '@/eslint/env/jest.ts'\nimport vitest from '@/eslint/env/vitest.ts'\nimport codecept from '@/eslint/env/codecept.ts'\nimport react from '@/eslint/env/react.ts'\nimport eslint from '@/eslint/env/eslint.ts'\nimport project from '@/eslint/env/project.ts'\nimport tsconfig from '@/eslint/env/tsconfig.ts'\nimport decorators from '@/eslint/env/decorators.ts'\n\n// types ======================================================================\n\nexport type { ConfigObject, LanguageOptions, PackagesOptions, RulesConfig, StylisticOptions, VueOptions }\n\n/**\n * Configuration options for linting the entire project with ESLint.\n */\nexport interface ProjectOptions {\n\n /**\n * The URL of the project root containing the ESLint configuration file.\n * Should usually be set to `import.meta.url`.\n */\n root: string\n\n /**\n * Glob patterns with all files and folders to be ignored by ESLint.\n */\n ignores?: readonly string[]\n\n /**\n * Path to the template file containing the license header to be used in all\n * source files. May be a path relative to the project root.\n */\n license?: string\n\n /**\n * Configuration options for language and project setup.\n */\n language?: LanguageOptions\n\n /**\n * Configuration options for external package dependencies.\n */\n packages?: PackagesOptions\n\n /**\n * Configuration options for code style.\n */\n stylistic?: StylisticOptions\n\n /**\n * Additional configuration options for Vue source files.\n */\n vue?: VueOptions\n\n /**\n * Additional linter rules to be added to the global configuration.\n */\n rules?: RulesConfig\n}\n\n// environment presets ========================================================\n\n/**\n * A collection with all available environment presets.\n */\nexport const env = {\n node,\n browser,\n jest,\n vitest,\n codecept,\n react,\n eslint,\n project,\n tsconfig,\n decorators,\n} as const\n\n// functions ==================================================================\n\n/**\n * Generates a complete ESLint configuration array.\n *\n * @param options\n * Options for the base configuration that will be generated.\n *\n * @param configs\n * Additional configuration entries: Each parameter may be a callback function\n * that will be invoked with a `PathResolver` utility.\n *\n * @returns\n * The resulting ESLint configuration array that must be returned from the\n * `eslint.config.*` file.\n */\nexport function defineConfig(options: ProjectOptions, ...configs: Array<ConfigArg | ((resolver: PathResolver) => ConfigArg)>): ConfigObject[] {\n\n const ignores: string[] = [\n '*/.yarn',\n 'dist',\n 'output',\n 'vite.config.ts.*.mjs',\n 'gitlab-ci',\n '.gitlab-ci.yml',\n 'coverage', // Vitest\n '.nuxt', // NuxtJS\n '.output', // NuxtJS\n ...(options.ignores ?? []),\n ]\n\n // resolve language configuration options\n const languageConfig: LanguageConfig = {\n ecmaVersion: 'latest',\n sourceType: 'module',\n ...options.language,\n }\n\n // resolve dependency configuration options\n const packagesConfig: PackagesConfig = {\n allowed: [],\n banned: [],\n ...options.packages,\n }\n\n // resolve stylistic configuration options\n const indent = options.stylistic?.indent ?? 2\n const stylisticConfig: StylisticConfig = {\n semi: 'never',\n quotes: 'single',\n dangle: 'always',\n funcSpacing: 'off',\n ...options.stylistic,\n indent,\n indentOverrides: {\n js: indent,\n json: indent,\n yaml: indent,\n vue: indent,\n ...options.stylistic?.indentOverrides,\n },\n }\n\n // the resolver for relative file paths\n const resolver = new PathResolver(options.root)\n\n return defineEslintConfig(flattenDeepArrays<Config>(\n\n // ignore certain files and folders\n globalIgnores(ignores, 'index:global-ignores'),\n\n // module types and standard rules for all JS/TS source files\n base(languageConfig),\n\n // default configuration for JavaScript files\n js(),\n\n // default configuration for TypeScript files\n ts(resolver.root),\n\n // default configuration for Vue.js files\n vue(resolver.root, stylisticConfig, options.vue),\n\n // default configuration for JSON files\n json(stylisticConfig),\n\n // default configuration for YAML files\n yaml(stylisticConfig),\n\n // default configuration for Markdown files\n markdown(),\n\n // check for correct license headers\n options.license ? license(resolver.path(options.license)) : undefined,\n\n // default configuration for ESLint inline directives\n directives(),\n\n // default configuration for outdated dependencies\n packages(packagesConfig),\n\n // default configuration for regular expressions\n regexp(),\n\n // default configuration for native promises\n promises(),\n\n // default configuration for JSDoc\n jsdoc(),\n\n // default configuration for code style checks\n stylistic(stylisticConfig),\n\n // custom rules\n options.rules && { name: 'core.index.custom-rules', rules: options.rules },\n\n // custom configuration entries\n configs.map(config => (typeof config === 'function') ? config(resolver) : config),\n ) as ConfigObject[])\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,UAAiB,gBAAmB,GAAG,QAAqD;CAC1F,KAAK,MAAM,WAAW,QACpB,IAAI,MAAM,QAAQ,OAAO,GACvB,OAAO,gBAAgB,GAAG,OAAO;MAC5B,IAAI,SACT,MAAM;AAGZ;;;;;;;;;;;;;AAcA,SAAgB,kBAAqB,GAAG,QAAqC;CAC3E,OAAO,CAAC,GAAG,gBAAgB,GAAG,MAAM,CAAC;AACvC;;;;;;ACoLA,MAAa,gBAAgB;CAAC;CAAM;CAAO;CAAO;AAAK;;;;AAKvD,MAAa,gBAAgB;CAAC;CAAM;CAAO;CAAO;AAAK;;;;AAKvD,MAAa,iBAAiB,CAAC,GAAG,eAAe,GAAG,aAAa;;;;AAKjE,MAAa,UAAU,QAAQ,aAAa;;;;AAK5C,MAAa,UAAU,QAAQ,aAAa;;;;AAK5C,MAAa,WAAW,QAAQ,cAAc,KAAI,QAAO,OAAO,GAAG,CAAC;;;;AAKpE,MAAa,WAAW,QAAQ,cAAc;;;;AAK9C,MAAa,WAAW,QAAQ,CAAC,KAAK,CAAC;;;;;AAMvC,MAAa,yBAAyB;CACpC,mBAAmB;CACnB,mBAAmB;CACnB,gCAAgC;CAChC,cAAc;CACd,oBAAoB;AACtB;;;;;AAMA,MAAa,+BA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AM,iBAAiB,QAAQ,GAAG,GAG/C,KAAK,eAAe,GAGpB,KAAK,eAAe,GAGpB,SAAS,GAGT,QAAQ,UAAU,QAAQ,SAAS,KAAK,QAAQ,OAAO,CAAC,IAAI,KAAA,GAG5D,WAAW,GAGX,SAAS,cAAc,GAGvB,OAAO,GAGP,SAAS,GAGTC,QAAM,GAGN,UAAU,eAAe,GAGzB,QAAQ,SAAS;EAAE,MAAM;EAA2B,OAAO,QAAQ;CAAM,GAGzE,QAAQ,KAAI,WAAW,OAAO,WAAW,aAAc,OAAO,QAAQ,IAAI,MAAM,CAClF,CAAmB;AACrB"}
@@ -1,7 +1,21 @@
1
1
  import { t as PathResolver } from "../resolver-Nkg5OKUN.mjs";
2
- import stylisticPlugin from "@stylistic/stylelint-plugin";
3
2
  import { readFile } from "node:fs/promises";
4
3
  import stylelint from "stylelint";
4
+ import lessPlugin from "stylelint-less";
5
+ import scssPlugin from "stylelint-scss";
6
+ import htmlConfig from "stylelint-config-html";
7
+ import recommendedConfig from "stylelint-config-recommended";
8
+ import recommendedLessConfig from "stylelint-config-recommended-less";
9
+ import recommendedScssConfig from "stylelint-config-recommended-scss";
10
+ import recommendedVueConfig from "stylelint-config-recommended-vue";
11
+ import recommendedVueScssConfig from "stylelint-config-recommended-vue/scss";
12
+ import standardConfig from "stylelint-config-standard";
13
+ import standardLessConfig from "stylelint-config-standard-less";
14
+ import standardScssConfig from "stylelint-config-standard-scss";
15
+ import standardVueConfig from "stylelint-config-standard-vue";
16
+ import standardVueScssConfig from "stylelint-config-standard-vue/scss";
17
+ import stylisticPlugin from "@stylistic/stylelint-plugin";
18
+ import stylisticConfig from "@stylistic/stylelint-config";
5
19
  //#region src/stylelint/rules/license-header.ts
6
20
  const { createPlugin, utils: { ruleMessages, validateOptions, report } } = stylelint;
7
21
  const ruleName = "license-header/header";
@@ -71,6 +85,67 @@ var license_header_default = createPlugin(ruleName, Object.assign(ruleFunc, {
71
85
  messages
72
86
  }));
73
87
  //#endregion
88
+ //#region src/stylelint/package-utils.ts
89
+ const PLUGINS = {
90
+ "@stylistic/stylelint-plugin": stylisticPlugin,
91
+ "stylelint-less": lessPlugin,
92
+ "stylelint-scss": scssPlugin
93
+ };
94
+ const CONFIGS = {
95
+ "@stylistic/stylelint-config": stylisticConfig,
96
+ "stylelint-config-html": htmlConfig,
97
+ "stylelint-config-recommended": recommendedConfig,
98
+ "stylelint-config-recommended-less": recommendedLessConfig,
99
+ "stylelint-config-recommended-scss": recommendedScssConfig,
100
+ "stylelint-config-recommended-vue": recommendedVueConfig,
101
+ "stylelint-config-recommended-vue/scss": recommendedVueScssConfig,
102
+ "stylelint-config-standard": standardConfig,
103
+ "stylelint-config-standard-less": standardLessConfig,
104
+ "stylelint-config-standard-scss": standardScssConfig,
105
+ "stylelint-config-standard-vue": standardVueConfig,
106
+ "stylelint-config-standard-vue/scss": standardVueScssConfig
107
+ };
108
+ /**
109
+ * Resolves string entries in the configuration options `plugins` and `extends`
110
+ * to imported objects.
111
+ *
112
+ * @param config
113
+ * The configuration to be resolved.
114
+ */
115
+ function resolveEntries(config) {
116
+ config.plugins &&= [config.plugins].flat().map((entry) => {
117
+ if (typeof entry !== "string") return entry;
118
+ const resolved = PLUGINS[entry];
119
+ if (!resolved) throw new Error(`unknown plugin package '${entry}'`);
120
+ return resolved;
121
+ });
122
+ config.extends &&= [config.extends].flat().map((entry) => {
123
+ if (typeof entry !== "string") return entry;
124
+ const resolved = CONFIGS[entry];
125
+ if (!resolved) throw new Error(`unknown extension package '${entry}'`);
126
+ return resolveConfigPackages(resolved);
127
+ });
128
+ }
129
+ /**
130
+ * Recursively resolves string entries in the `extends` configuration option
131
+ * with the resolved packages. Needed to workaround broken import resolution in
132
+ * stylelint with pnpm.
133
+ *
134
+ * @template ConfigT
135
+ * The exact type of the configuration (e.g. override config with files).
136
+ *
137
+ * @param config
138
+ * The configuration to be resolved.
139
+ *
140
+ * @returns
141
+ * The passed configuration object with resolved extensions.
142
+ */
143
+ function resolveConfigPackages(config) {
144
+ resolveEntries(config);
145
+ config.overrides?.forEach(resolveEntries);
146
+ return config;
147
+ }
148
+ //#endregion
74
149
  //#region src/stylelint/index.ts
75
150
  /**
76
151
  * Generates a StyleLint configuration object targeting the source files in the
@@ -98,7 +173,6 @@ function defineConfig(options) {
98
173
  ...options.stylistic
99
174
  };
100
175
  const resolver = new PathResolver(options.root);
101
- const plugins = [];
102
176
  const overrides = [];
103
177
  const rules = {
104
178
  base: {
@@ -124,7 +198,6 @@ function defineConfig(options) {
124
198
  },
125
199
  less: {}
126
200
  };
127
- plugins.push(stylisticPlugin);
128
201
  Object.assign(rules.base, {
129
202
  "@stylistic/declaration-colon-newline-after": null,
130
203
  "@stylistic/indentation": [stylistic.indent, { ignore: ["inside-parens"] }],
@@ -135,21 +208,16 @@ function defineConfig(options) {
135
208
  });
136
209
  if (options.license) overrides.push({
137
210
  files: ["**/*.{css,scss,less}"],
138
- plugins: [license_header_default],
211
+ plugins: license_header_default,
139
212
  rules: { "license-header/header": resolver.path(options.license) }
140
213
  });
141
- if (options.vue?.rules) overrides.push({
142
- files: ["**/*.vue"],
143
- rules: options.vue.rules
144
- });
145
214
  if (options.rules) for (const [name, rule] of Object.entries(options.rules)) {
146
215
  const key = name.split("/")[0];
147
216
  (rules[key] ?? rules.base)[name] = rule;
148
217
  }
149
- return {
218
+ return resolveConfigPackages({
150
219
  ignoreFiles,
151
- plugins,
152
- extends: ["@stylistic/stylelint-config", options.vue?.lang === "scss" ? "stylelint-config-standard-vue/scss" : "stylelint-config-standard-vue"],
220
+ extends: ["@stylistic/stylelint-config"],
153
221
  rules: rules.base,
154
222
  reportDescriptionlessDisables: null,
155
223
  reportInvalidScopeDisables: true,
@@ -158,17 +226,22 @@ function defineConfig(options) {
158
226
  overrides: [
159
227
  {
160
228
  files: ["**/*.scss"],
161
- extends: ["stylelint-config-standard-scss"],
229
+ extends: "stylelint-config-standard-scss",
162
230
  rules: rules.scss
163
231
  },
164
232
  {
165
233
  files: ["**/*.less"],
166
- extends: ["stylelint-config-standard-less"],
234
+ extends: "stylelint-config-standard-less",
167
235
  rules: rules.less
168
236
  },
237
+ {
238
+ files: ["**/*.vue"],
239
+ extends: options.vue?.lang === "scss" ? "stylelint-config-standard-vue/scss" : "stylelint-config-standard-vue",
240
+ rules: options.vue?.rules
241
+ },
169
242
  ...overrides
170
243
  ]
171
- };
244
+ });
172
245
  }
173
246
  //#endregion
174
247
  export { defineConfig };
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["licensePlugin"],"sources":["../../src/stylelint/rules/license-header.ts","../../src/stylelint/index.ts"],"sourcesContent":["\nimport { readFile } from 'node:fs/promises'\nimport stylelint from 'stylelint'\n\nconst { createPlugin, utils: { ruleMessages, validateOptions, report } } = stylelint\n\n// types ======================================================================\n\ntype RuleMeta = stylelint.RuleMeta\ntype RuleFunction = stylelint.RuleBase<string, unknown>\n\n// constants ==================================================================\n\nconst ruleName = 'license-header/header'\n\nconst messages = ruleMessages(ruleName, {\n rejectedMissing: 'Missing license header',\n rejectedInvalid: 'Invalid license header',\n})\n\nconst meta: RuleMeta = {\n url: 'https://gitlab.open-xchange.com/fspd/commons/plugins/-/blob/main/packages/linter-presets/docs/stylelint/README.md',\n fixable: true,\n}\n\n// functions ==================================================================\n\nconst promiseCache = new Map<string, Promise<string>>()\n\n/**\n * Reads the license header file once per file path.\n *\n * @param path\n * The path to the license header file.\n *\n * @returns\n * A promise that will resolve with the contents of the license header file.\n */\nconst readLicenseHeaderOnce = async (path: string): Promise<string> => {\n let promise = promiseCache.get(path)\n if (!promise) {\n promise = readFile(path, 'utf-8')\n promiseCache.set(path, promise)\n }\n return await promise\n}\n\n/**\n * Implementation of the linter rule.\n *\n * @param primary\n * The path to the license header file.\n *\n * @returns\n * The callback function for the linter.\n */\nconst ruleFunc: RuleFunction = (primary) => async (root, result) => {\n\n // validate rule options\n if (!validateOptions(result, ruleName, {\n actual: primary,\n possible: path => (typeof path === 'string') && (path.length > 0),\n })) return\n\n // find the first comment in the linted file\n type Comment = Parameters<Parameters<typeof root.walkComments>[0]>[0]\n let comment: Comment | undefined\n root.walkComments(node => {\n if (node.parent === root) comment = node // must be a top-level comment\n return false // always stop iteration after first comment\n })\n\n // read the license header file\n const license = await readLicenseHeaderOnce(primary)\n\n // exit successfully if comment found and matches the license header file\n if (comment) {\n // strip block comment markers for comparison\n const stripped = license.trim().replace(/^\\/\\*|\\*\\/$/g, '').trim()\n if (comment.text === stripped) return\n }\n\n // report missing or mismatching comment\n report({\n ruleName,\n result,\n message: comment ? messages.rejectedInvalid : messages.rejectedMissing,\n node: comment ?? root,\n fix: () => { root.prepend(license) },\n })\n}\n\n// exports ====================================================================\n\nexport default createPlugin(ruleName, Object.assign(ruleFunc, { meta, ruleName, messages }))\n","\nimport type { Config, ConfigRuleSettings, Plugin } from 'stylelint'\nimport stylisticPlugin from '@stylistic/stylelint-plugin'\nimport licensePlugin from '@/stylelint/rules/license-header.ts'\n\nimport { PathResolver } from '@/utils/resolver.ts'\n\n// types ======================================================================\n\n/**\n * Configuration for multiple rules.\n */\nexport type RuleRecord = Record<string, ConfigRuleSettings<unknown, object>>\n\n// ----------------------------------------------------------------------------\n\n/**\n * Configuration options for StyleLint code style rules.\n */\nexport interface StylisticOptions {\n\n /**\n * Default indentation size (number of space characters).\n *\n * @default 2\n */\n indent?: number\n\n /**\n * The type of the string delimiter character.\n *\n * @default 'single'\n */\n quotes?: 'single' | 'double' | 'off'\n}\n\n// ----------------------------------------------------------------------------\n\n/**\n * Configuration options for linting vue files.\n */\nexport interface VueOptions {\n\n /**\n * The language parser plugin to be used.\n *\n * @default 'css'\n */\n lang?: 'css' | 'scss'\n\n /**\n * Additional linter rules to be added to the global configuration.\n */\n rules?: RuleRecord\n}\n\n// ----------------------------------------------------------------------------\n\n/**\n * Configuration options for linting the entire project with StyleLint.\n */\nexport interface ProjectOptions {\n\n /**\n * The URL of the project root containing the StyleLint configuration file.\n * Should usually be set to `import.meta.url`.\n */\n root: string\n\n /**\n * Glob patterns for all files to be ignored by StyleLint (the patterns must\n * match files, plain directory names are not supported).\n */\n ignores?: string[]\n\n /**\n * Path to the template file containing the license header to be used in all\n * source files. May be a path relative to the project root.\n */\n license?: string\n\n /**\n * Configuration options for code style.\n */\n stylistic?: StylisticOptions\n\n /**\n * Options for linting styles in Vue files.\n */\n vue?: VueOptions\n\n /**\n * Additional linter rules to be added to the global configuration.\n */\n rules?: RuleRecord\n}\n\n// functions ==================================================================\n\n/**\n * Generates a StyleLint configuration object targeting the source files in the\n * entire project.\n *\n * @param options\n * Plugin configuration options.\n *\n * @returns\n * The configuration object to be exported from `stylelint.config.js`.\n */\nexport function defineConfig(options: ProjectOptions): Config {\n\n const ignoreFiles: string[] = [\n 'node_modules/**/*',\n 'dist/**/*',\n 'output/**/*',\n 'coverage/**/*', // Vitest\n '.nuxt/**/*', // NuxtJS\n '.output/**/*', // NuxtJS\n ...(options.ignores ?? []),\n ]\n\n // resolve stylistic configuration options\n const stylistic: StylisticOptions = {\n indent: 2,\n quotes: 'single',\n ...options.stylistic,\n }\n\n // the resolver for relative file paths\n const resolver = new PathResolver(options.root)\n\n // all plugins to be loaded\n const plugins: Plugin[] = []\n\n // custom overrides\n const overrides: Config['overrides'] = []\n\n // custom rules, grouped by language type\n const rules: Record<string, RuleRecord> = {\n base: {\n 'at-rule-empty-line-before': null,\n 'color-function-notation': ['modern', { ignore: ['with-var-inside'] }],\n 'color-hex-length': null,\n 'comment-empty-line-before': null,\n 'custom-property-empty-line-before': null,\n 'declaration-block-no-redundant-longhand-properties': [true, { ignoreShorthands: ['inset'] }], // Safari does not support 'inset'\n 'declaration-block-single-line-max-declarations': null,\n 'declaration-empty-line-before': null,\n 'function-url-no-scheme-relative': true,\n 'function-url-scheme-allowed-list': ['data'],\n 'media-feature-range-notation': 'prefix', // Safari 16.3 does not work with this notation\n 'no-descending-specificity': null,\n 'no-unknown-animations': true,\n 'rule-empty-line-before': null,\n 'shorthand-property-no-redundant-values': [true, { ignore: ['four-into-three-edge-values'] }],\n },\n scss: {\n 'scss/dollar-variable-empty-line-before': null,\n 'scss/double-slash-comment-empty-line-before': null,\n },\n less: {},\n }\n\n // @stylistic plugin\n plugins.push(stylisticPlugin)\n Object.assign(rules.base, {\n '@stylistic/declaration-colon-newline-after': null,\n '@stylistic/indentation': [stylistic.indent, { ignore: ['inside-parens'] }],\n '@stylistic/max-line-length': null,\n '@stylistic/no-empty-first-line': null,\n '@stylistic/selector-list-comma-newline-after': null,\n '@stylistic/string-quotes': (stylistic.quotes === 'off') ? null : [stylistic.quotes, { avoidEscape: true }],\n })\n\n // license header plugin\n if (options.license) {\n overrides.push({\n files: ['**/*.{css,scss,less}'], // not for Vue files\n plugins: [licensePlugin],\n rules: {\n 'license-header/header': resolver.path(options.license),\n },\n })\n }\n\n // '.vue' files\n if (options.vue?.rules) {\n overrides.push({\n files: ['**/*.vue'],\n rules: options.vue.rules,\n })\n }\n\n // distribute custom rules by language type\n if (options.rules) {\n for (const [name, rule] of Object.entries(options.rules)) {\n const key = name.split('/')[0];\n (rules[key] ?? rules.base)[name] = rule\n }\n }\n\n return {\n\n // ignore certain files and folders\n ignoreFiles,\n\n // language plugins\n plugins,\n\n // add recommended configurations\n extends: [\n '@stylistic/stylelint-config',\n (options.vue?.lang === 'scss') ? 'stylelint-config-standard-vue/scss' : 'stylelint-config-standard-vue',\n ],\n\n // rules for all language types\n rules: rules.base,\n\n // check inline directives\n reportDescriptionlessDisables: null,\n reportInvalidScopeDisables: true,\n reportNeedlessDisables: true,\n reportUnscopedDisables: true,\n\n // overrides for custom languages\n overrides: [\n\n // '.scss' files\n {\n files: ['**/*.scss'],\n extends: ['stylelint-config-standard-scss'],\n rules: rules.scss,\n },\n\n // '.less' files\n {\n files: ['**/*.less'],\n extends: ['stylelint-config-standard-less'],\n rules: rules.less,\n },\n\n ...overrides,\n ],\n }\n}\n"],"mappings":";;;;;AAIA,MAAM,EAAE,cAAc,OAAO,EAAE,cAAc,iBAAiB,aAAa;AAS3E,MAAM,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K,MAAM,GAAG,CAAC,CAAC;EAC5B,CAAC,MAAM,QAAQ,MAAM,KAAA,CAAM,QAAQ;CACrC;CAGF,OAAO;EAGL;EAGA;EAGA,SAAS,CACP,+BACC,QAAQ,KAAK,SAAS,SAAU,uCAAuC,+BAC1E;EAGA,OAAO,MAAM;EAGb,+BAA+B;EAC/B,4BAA4B;EAC5B,wBAAwB;EACxB,wBAAwB;EAGxB,WAAW;GAGT;IACE,OAAO,CAAC,WAAW;IACnB,SAAS,CAAC,gCAAgC;IAC1C,OAAO,MAAM;GACf;GAGA;IACE,OAAO,CAAC,WAAW;IACnB,SAAS,CAAC,gCAAgC;IAC1C,OAAO,MAAM;GACf;GAEA,GAAG;EACL;CACF;AACF"}
1
+ {"version":3,"file":"index.mjs","names":["licensePlugin"],"sources":["../../src/stylelint/rules/license-header.ts","../../src/stylelint/package-utils.ts","../../src/stylelint/index.ts"],"sourcesContent":["\nimport { readFile } from 'node:fs/promises'\nimport stylelint from 'stylelint'\n\nconst { createPlugin, utils: { ruleMessages, validateOptions, report } } = stylelint\n\n// types ======================================================================\n\ntype RuleMeta = stylelint.RuleMeta\ntype RuleFunction = stylelint.RuleBase<string, unknown>\n\n// constants ==================================================================\n\nconst ruleName = 'license-header/header'\n\nconst messages = ruleMessages(ruleName, {\n rejectedMissing: 'Missing license header',\n rejectedInvalid: 'Invalid license header',\n})\n\nconst meta: RuleMeta = {\n url: 'https://gitlab.open-xchange.com/fspd/commons/plugins/-/blob/main/packages/linter-presets/docs/stylelint/README.md',\n fixable: true,\n}\n\n// functions ==================================================================\n\nconst promiseCache = new Map<string, Promise<string>>()\n\n/**\n * Reads the license header file once per file path.\n *\n * @param path\n * The path to the license header file.\n *\n * @returns\n * A promise that will resolve with the contents of the license header file.\n */\nconst readLicenseHeaderOnce = async (path: string): Promise<string> => {\n let promise = promiseCache.get(path)\n if (!promise) {\n promise = readFile(path, 'utf-8')\n promiseCache.set(path, promise)\n }\n return await promise\n}\n\n/**\n * Implementation of the linter rule.\n *\n * @param primary\n * The path to the license header file.\n *\n * @returns\n * The callback function for the linter.\n */\nconst ruleFunc: RuleFunction = (primary) => async (root, result) => {\n\n // validate rule options\n if (!validateOptions(result, ruleName, {\n actual: primary,\n possible: path => (typeof path === 'string') && (path.length > 0),\n })) return\n\n // find the first comment in the linted file\n type Comment = Parameters<Parameters<typeof root.walkComments>[0]>[0]\n let comment: Comment | undefined\n root.walkComments(node => {\n if (node.parent === root) comment = node // must be a top-level comment\n return false // always stop iteration after first comment\n })\n\n // read the license header file\n const license = await readLicenseHeaderOnce(primary)\n\n // exit successfully if comment found and matches the license header file\n if (comment) {\n // strip block comment markers for comparison\n const stripped = license.trim().replace(/^\\/\\*|\\*\\/$/g, '').trim()\n if (comment.text === stripped) return\n }\n\n // report missing or mismatching comment\n report({\n ruleName,\n result,\n message: comment ? messages.rejectedInvalid : messages.rejectedMissing,\n node: comment ?? root,\n fix: () => { root.prepend(license) },\n })\n}\n\n// exports ====================================================================\n\nexport default createPlugin(ruleName, Object.assign(ruleFunc, { meta, ruleName, messages }))\n","\nimport type { Config, Plugin } from 'stylelint'\nimport lessPlugin from 'stylelint-less'\nimport scssPlugin from 'stylelint-scss'\nimport htmlConfig from 'stylelint-config-html'\nimport recommendedConfig from 'stylelint-config-recommended'\nimport recommendedLessConfig from 'stylelint-config-recommended-less'\nimport recommendedScssConfig from 'stylelint-config-recommended-scss'\nimport recommendedVueConfig from 'stylelint-config-recommended-vue'\nimport recommendedVueScssConfig from 'stylelint-config-recommended-vue/scss'\nimport standardConfig from 'stylelint-config-standard'\nimport standardLessConfig from 'stylelint-config-standard-less'\nimport standardScssConfig from 'stylelint-config-standard-scss'\nimport standardVueConfig from 'stylelint-config-standard-vue'\nimport standardVueScssConfig from 'stylelint-config-standard-vue/scss'\nimport stylisticPlugin from '@stylistic/stylelint-plugin'\nimport stylisticConfig from '@stylistic/stylelint-config'\n\n// constants ==================================================================\n\nconst PLUGINS: Record<string, Plugin | undefined> = {\n '@stylistic/stylelint-plugin': stylisticPlugin,\n 'stylelint-less': lessPlugin,\n 'stylelint-scss': scssPlugin,\n}\n\nconst CONFIGS: Record<string, Config | undefined> = {\n '@stylistic/stylelint-config': stylisticConfig,\n 'stylelint-config-html': htmlConfig,\n 'stylelint-config-recommended': recommendedConfig,\n 'stylelint-config-recommended-less': recommendedLessConfig,\n 'stylelint-config-recommended-scss': recommendedScssConfig,\n 'stylelint-config-recommended-vue': recommendedVueConfig,\n 'stylelint-config-recommended-vue/scss': recommendedVueScssConfig,\n 'stylelint-config-standard': standardConfig,\n 'stylelint-config-standard-less': standardLessConfig,\n 'stylelint-config-standard-scss': standardScssConfig,\n 'stylelint-config-standard-vue': standardVueConfig,\n 'stylelint-config-standard-vue/scss': standardVueScssConfig,\n}\n\n// functions ==================================================================\n\n/**\n * Resolves string entries in the configuration options `plugins` and `extends`\n * to imported objects.\n *\n * @param config\n * The configuration to be resolved.\n */\nfunction resolveEntries(config: Config): void {\n\n // resolve string references to plugin packages\n config.plugins &&= [config.plugins].flat().map(entry => {\n if (typeof entry !== 'string') return entry\n const resolved = PLUGINS[entry]\n if (!resolved) throw new Error(`unknown plugin package '${entry}'`)\n return resolved\n })\n\n // resolve string references to extension packages\n // @ts-expect-error -- broken types\n config.extends &&= [config.extends].flat().map(entry => {\n if (typeof entry !== 'string') return entry\n const resolved = CONFIGS[entry]\n if (!resolved) throw new Error(`unknown extension package '${entry}'`)\n // recursively resolve extensions in imported package\n return resolveConfigPackages(resolved)\n })\n}\n\n/**\n * Recursively resolves string entries in the `extends` configuration option\n * with the resolved packages. Needed to workaround broken import resolution in\n * stylelint with pnpm.\n *\n * @template ConfigT\n * The exact type of the configuration (e.g. override config with files).\n *\n * @param config\n * The configuration to be resolved.\n *\n * @returns\n * The passed configuration object with resolved extensions.\n */\nexport function resolveConfigPackages<ConfigT extends Config>(config: ConfigT): ConfigT {\n resolveEntries(config)\n config.overrides?.forEach(resolveEntries)\n return config\n}\n","\nimport type { Config, ConfigRuleSettings } from 'stylelint'\n\nimport licensePlugin from '@/stylelint/rules/license-header.ts'\nimport { resolveConfigPackages } from '@/stylelint/package-utils.ts'\nimport { PathResolver } from '@/utils/resolver.ts'\n\n// types ======================================================================\n\n/**\n * Configuration for multiple rules.\n */\nexport type RuleRecord = Record<string, ConfigRuleSettings<unknown, object>>\n\n// ----------------------------------------------------------------------------\n\n/**\n * Configuration options for StyleLint code style rules.\n */\nexport interface StylisticOptions {\n\n /**\n * Default indentation size (number of space characters).\n *\n * @default 2\n */\n indent?: number\n\n /**\n * The type of the string delimiter character.\n *\n * @default 'single'\n */\n quotes?: 'single' | 'double' | 'off'\n}\n\n// ----------------------------------------------------------------------------\n\n/**\n * Configuration options for linting vue files.\n */\nexport interface VueOptions {\n\n /**\n * The language parser plugin to be used.\n *\n * @default 'css'\n */\n lang?: 'css' | 'scss'\n\n /**\n * Additional linter rules to be added to the global configuration.\n */\n rules?: RuleRecord\n}\n\n// ----------------------------------------------------------------------------\n\n/**\n * Configuration options for linting the entire project with StyleLint.\n */\nexport interface ProjectOptions {\n\n /**\n * The URL of the project root containing the StyleLint configuration file.\n * Should usually be set to `import.meta.url`.\n */\n root: string\n\n /**\n * Glob patterns for all files to be ignored by StyleLint (the patterns must\n * match files, plain directory names are not supported).\n */\n ignores?: string[]\n\n /**\n * Path to the template file containing the license header to be used in all\n * source files. May be a path relative to the project root.\n */\n license?: string\n\n /**\n * Configuration options for code style.\n */\n stylistic?: StylisticOptions\n\n /**\n * Options for linting styles in Vue files.\n */\n vue?: VueOptions\n\n /**\n * Additional linter rules to be added to the global configuration.\n */\n rules?: RuleRecord\n}\n\n// functions ==================================================================\n\n/**\n * Generates a StyleLint configuration object targeting the source files in the\n * entire project.\n *\n * @param options\n * Plugin configuration options.\n *\n * @returns\n * The configuration object to be exported from `stylelint.config.js`.\n */\nexport function defineConfig(options: ProjectOptions): Config {\n\n const ignoreFiles: string[] = [\n 'node_modules/**/*',\n 'dist/**/*',\n 'output/**/*',\n 'coverage/**/*', // Vitest\n '.nuxt/**/*', // NuxtJS\n '.output/**/*', // NuxtJS\n ...(options.ignores ?? []),\n ]\n\n // resolve stylistic configuration options\n const stylistic: StylisticOptions = {\n indent: 2,\n quotes: 'single',\n ...options.stylistic,\n }\n\n // the resolver for relative file paths\n const resolver = new PathResolver(options.root)\n\n // custom overrides\n const overrides: Config['overrides'] = []\n\n // custom rules, grouped by language type\n const rules: Record<string, RuleRecord> = {\n base: {\n 'at-rule-empty-line-before': null,\n 'color-function-notation': ['modern', { ignore: ['with-var-inside'] }],\n 'color-hex-length': null,\n 'comment-empty-line-before': null,\n 'custom-property-empty-line-before': null,\n 'declaration-block-no-redundant-longhand-properties': [true, { ignoreShorthands: ['inset'] }], // Safari does not support 'inset'\n 'declaration-block-single-line-max-declarations': null,\n 'declaration-empty-line-before': null,\n 'function-url-no-scheme-relative': true,\n 'function-url-scheme-allowed-list': ['data'],\n 'media-feature-range-notation': 'prefix', // Safari 16.3 does not work with this notation\n 'no-descending-specificity': null,\n 'no-unknown-animations': true,\n 'rule-empty-line-before': null,\n 'shorthand-property-no-redundant-values': [true, { ignore: ['four-into-three-edge-values'] }],\n },\n scss: {\n 'scss/dollar-variable-empty-line-before': null,\n 'scss/double-slash-comment-empty-line-before': null,\n },\n less: {},\n }\n\n // override rules of @stylistic plugin\n Object.assign(rules.base, {\n '@stylistic/declaration-colon-newline-after': null,\n '@stylistic/indentation': [stylistic.indent, { ignore: ['inside-parens'] }],\n '@stylistic/max-line-length': null,\n '@stylistic/no-empty-first-line': null,\n '@stylistic/selector-list-comma-newline-after': null,\n '@stylistic/string-quotes': (stylistic.quotes === 'off') ? null : [stylistic.quotes, { avoidEscape: true }],\n })\n\n // license header plugin\n if (options.license) {\n overrides.push({\n files: ['**/*.{css,scss,less}'], // not for Vue files\n plugins: licensePlugin,\n rules: {\n 'license-header/header': resolver.path(options.license),\n },\n })\n }\n\n // distribute custom rules by language type\n if (options.rules) {\n for (const [name, rule] of Object.entries(options.rules)) {\n const key = name.split('/')[0];\n (rules[key] ?? rules.base)[name] = rule\n }\n }\n\n return resolveConfigPackages({\n\n // ignore certain files and folders\n ignoreFiles,\n\n // add recommended configurations\n extends: [\n '@stylistic/stylelint-config',\n ],\n\n // rules for all language types\n rules: rules.base,\n\n // check inline directives\n reportDescriptionlessDisables: null,\n reportInvalidScopeDisables: true,\n reportNeedlessDisables: true,\n reportUnscopedDisables: true,\n\n // overrides for custom languages\n overrides: [\n\n // '.scss' files\n {\n files: ['**/*.scss'],\n extends: 'stylelint-config-standard-scss',\n rules: rules.scss,\n },\n\n // '.less' files\n {\n files: ['**/*.less'],\n extends: 'stylelint-config-standard-less',\n rules: rules.less,\n },\n\n // '.vue' files\n {\n files: ['**/*.vue'],\n extends: (options.vue?.lang === 'scss') ?\n 'stylelint-config-standard-vue/scss' :\n 'stylelint-config-standard-vue',\n rules: options.vue?.rules,\n },\n\n ...overrides,\n ],\n })\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAIA,MAAM,EAAE,cAAc,OAAO,EAAE,cAAc,iBAAiB,aAAa;AAS3E,MAAM,WAAW;AAEjB,MAAM,WAAW,aAAa,UAAU;CACtC,iBAAiB;CACjB,iBAAiB;AACnB,CAAC;AAED,MAAM,OAAiB;CACrB,KAAK;CACL,SAAS;AACX;AAIA,MAAM,+BAAe,IAAI,IAA6B;;;;;;;;;;AAWtD,MAAM,wBAAwB,OAAO,SAAkC;CACrE,IAAI,UAAU,aAAa,IAAI,IAAI;CACnC,IAAI,CAAC,SAAS;EACZ,UAAU,SAAS,MAAM,OAAO;EAChC,aAAa,IAAI,MAAM,OAAO;CAChC;CACA,OAAO,MAAM;AACf;;;;;;;;;;AAWA,MAAM,YAA0B,YAAY,OAAO,MAAM,WAAW;CAGlE,IAAI,CAAC,gBAAgB,QAAQ,UAAU;EACrC,QAAQ;EACR,WAAU,SAAS,OAAO,SAAS,YAAc,KAAK,SAAS;CACjE,CAAC,GAAG;CAIJ,IAAI;CACJ,KAAK,cAAa,SAAQ;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ACL,yBAAyB,SAAS,KAAK,QAAQ,OAAO,EACxD;CACF,CAAC;CAIH,IAAI,QAAQ,OACV,KAAK,MAAM,CAAC,MAAM,SAAS,OAAO,QAAQ,QAAQ,KAAK,GAAG;EACxD,MAAM,MAAM,KAAK,MAAM,GAAG,CAAC,CAAC;EAC5B,CAAC,MAAM,QAAQ,MAAM,KAAA,CAAM,QAAQ;CACrC;CAGF,OAAO,sBAAsB;EAG3B;EAGA,SAAS,CACP,6BACF;EAGA,OAAO,MAAM;EAGb,+BAA+B;EAC/B,4BAA4B;EAC5B,wBAAwB;EACxB,wBAAwB;EAGxB,WAAW;GAGT;IACE,OAAO,CAAC,WAAW;IACnB,SAAS;IACT,OAAO,MAAM;GACf;GAGA;IACE,OAAO,CAAC,WAAW;IACnB,SAAS;IACT,OAAO,MAAM;GACf;GAGA;IACE,OAAO,CAAC,UAAU;IAClB,SAAU,QAAQ,KAAK,SAAS,SAC9B,uCACA;IACF,OAAO,QAAQ,KAAK;GACtB;GAEA,GAAG;EACL;CACF,CAAC;AACH"}
@@ -21,8 +21,9 @@ function react(options: EnvReactOptions): ConfigArg
21
21
  | `files` | `Array<string\|string[]>` | _required_ | Glob patterns for source files to be included. Use embedded arrays for AND patterns. |
22
22
  | `ignores` | `string[]` | `[]` | Glob patterns for source files matching `files` to be ignored. |
23
23
  | `rules` | `RulesConfig` | `{}` | Additional linter rules to be added to the configuration. |
24
- | `effectHooks` | `string[]` | `[]` | Additional hooks that will be treated as effect hooks, like 'useEffect'. Used by the rule [`@eslint-react/exhaustive-deps`](https://www.eslint-react.xyz/docs/rules/exhaustive-deps). |
25
24
  | `stateHooks` | `string[]` | `[]` | Additional hooks that will be treated as state hooks, like 'useState'. Used by the rule [`@eslint-react/set-state-in-effect`](https://www.eslint-react.xyz/docs/rules/set-state-in-effect). |
25
+ | `refHooks` | `string[]` | `[]` | Additional hooks that will be treated as hooks returning React refs, like 'useRef'. Used by various rules. |
26
+ | `effectHooks` | `string[]` | `[]` | Additional hooks that will be treated as effect hooks, like 'useEffect'. Used by the rule [`@eslint-react/exhaustive-deps`](https://www.eslint-react.xyz/docs/rules/exhaustive-deps). |
26
27
 
27
28
  ## Example
28
29
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-xchange/linter-presets",
3
- "version": "1.28.0",
3
+ "version": "1.29.1",
4
4
  "description": "Configuration presets for ESLint and StyleLint",
5
5
  "repository": {
6
6
  "type": "git",
@@ -29,8 +29,8 @@
29
29
  "@babel/core": "^8.0.1",
30
30
  "@babel/eslint-parser": "^8.0.1",
31
31
  "@eslint-community/eslint-plugin-eslint-comments": "^4.7.2",
32
- "@eslint-react/eslint-plugin": "^5.18.0",
33
- "@eslint-react/kit": "^5.18.0",
32
+ "@eslint-react/eslint-plugin": "^5.18.2",
33
+ "@eslint-react/kit": "^5.18.2",
34
34
  "@eslint/compat": "^2.1.0",
35
35
  "@eslint/config-helpers": "^0.7.0",
36
36
  "@eslint/core": "^1.2.1",
@@ -42,7 +42,7 @@
42
42
  "@stylistic/stylelint-plugin": "^5.2.1",
43
43
  "@types/json-schema": "^7.0.15",
44
44
  "@types/picomatch": "^4.0.3",
45
- "@vitest/eslint-plugin": "^1.6.24",
45
+ "@vitest/eslint-plugin": "^1.6.26",
46
46
  "@vue/eslint-config-typescript": "^14.9.0",
47
47
  "confusing-browser-globals": "^1.0.11",
48
48
  "empathic": "^2.0.1",
@@ -51,10 +51,10 @@
51
51
  "eslint-plugin-depend": "^1.5.0",
52
52
  "eslint-plugin-eslint-plugin": "^7.6.0",
53
53
  "eslint-plugin-jest": "^29.16.0",
54
- "eslint-plugin-jest-dom": "^5.6.0",
54
+ "eslint-plugin-jest-dom": "^5.10.1",
55
55
  "eslint-plugin-jest-extended": "^3.0.1",
56
- "eslint-plugin-jsdoc": "^63.3.2",
57
- "eslint-plugin-jsonc": "^3.3.0",
56
+ "eslint-plugin-jsdoc": "^63.3.3",
57
+ "eslint-plugin-jsonc": "^3.4.1",
58
58
  "eslint-plugin-jsx-a11y": "^6.10.2",
59
59
  "eslint-plugin-license-header": "^0.9.0",
60
60
  "eslint-plugin-n": "^18.2.2",
@@ -65,21 +65,28 @@
65
65
  "eslint-plugin-regexp": "^3.1.1",
66
66
  "eslint-plugin-testing-library": "^7.16.2",
67
67
  "eslint-plugin-vue": "^10.10.0",
68
- "eslint-plugin-yml": "^3.6.0",
69
- "globals": "^17.8.0",
68
+ "eslint-plugin-yml": "^3.8.1",
69
+ "globals": "^17.9.0",
70
70
  "picomatch": "^4.0.5",
71
- "postcss-html": "^1.8.1",
71
+ "postcss-html": "^2.0.0",
72
+ "stylelint-config-html": "^2.0.0",
73
+ "stylelint-config-recommended": "^18.0.0",
74
+ "stylelint-config-recommended-less": "^4.2.1",
75
+ "stylelint-config-recommended-scss": "^17.0.1",
76
+ "stylelint-config-recommended-vue": "^2.0.0",
72
77
  "stylelint-config-standard": "^40.0.0",
73
78
  "stylelint-config-standard-less": "^4.1.0",
74
79
  "stylelint-config-standard-scss": "^17.0.0",
75
- "stylelint-config-standard-vue": "^1.0.0",
76
- "typescript-eslint": "^8.65.0"
80
+ "stylelint-config-standard-vue": "^2.0.0",
81
+ "stylelint-less": "^4.2.1",
82
+ "stylelint-scss": "^7.2.0",
83
+ "typescript-eslint": "^8.66.0"
77
84
  },
78
85
  "devDependencies": {
79
86
  "@jest/globals": "^30.4.1",
80
87
  "@types/confusing-browser-globals": "^1.0.3",
81
- "@types/react": "^19.2.17",
82
- "@typescript-eslint/utils": "^8.65.0",
88
+ "@types/react": "^19.2.18",
89
+ "@typescript-eslint/utils": "^8.66.0",
83
90
  "eslint": "^10.8.0",
84
91
  "jest": "^30.4.2",
85
92
  "stylelint": "^17.14.1",