@standard-config/eslint 1.4.0 → 1.4.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/dist/index.mjs CHANGED
@@ -21,7 +21,10 @@ const config = {
21
21
  },
22
22
  languageOptions: {
23
23
  parser: tseslint.parser,
24
- parserOptions: { projectService: true }
24
+ parserOptions: {
25
+ projectService: true,
26
+ warnOnUnsupportedTypeScriptVersion: false
27
+ }
25
28
  },
26
29
  linterOptions: {
27
30
  reportUnusedDisableDirectives: "error",
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["config","config","config","_includeIgnoreFile","eslintDefineConfig","configIgnores","configBase","configConfigFiles","configReact"],"sources":["../src/config-base/index.ts","../src/config-config-files/index.ts","../src/config-react/index.ts","../src/config-ignores/index.ts","../src/define-config/index.ts"],"sourcesContent":["import type { LinterConfigEntry } from '../types/index.d.ts';\nimport pluginPerfectionist from 'eslint-plugin-perfectionist';\nimport tseslint from 'typescript-eslint';\n\n/**\n * This config is intentionally limited to rules not supported by Oxlint\n * and formatting options not supported by Prettier.\n */\nconst config: LinterConfigEntry = {\n\tname: 'Base Config',\n\tplugins: {\n\t\t'@typescript-eslint': tseslint.plugin,\n\t\t'perfectionist': pluginPerfectionist,\n\t},\n\tlanguageOptions: {\n\t\tparser: tseslint.parser,\n\t\tparserOptions: {\n\t\t\tprojectService: true,\n\t\t},\n\t},\n\tlinterOptions: {\n\t\treportUnusedDisableDirectives: 'error',\n\t\treportUnusedInlineConfigs: 'error',\n\t},\n\trules: {\n\t\t/* oxlint-disable-next-line unicorn/no-useless-spread */\n\t\t...{\n\t\t\t'camelcase': ['error', { properties: 'always' }],\n\t\t\t'dot-notation': 'error',\n\t\t\t'func-name-matching': [\n\t\t\t\t'error',\n\t\t\t\t'never',\n\t\t\t\t{ considerPropertyDescriptor: true },\n\t\t\t],\n\t\t},\n\t\t'@typescript-eslint/consistent-type-assertions': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\tassertionStyle: 'as',\n\t\t\t\tobjectLiteralTypeAssertions: 'allow-as-parameter',\n\t\t\t},\n\t\t],\n\t\t'@typescript-eslint/consistent-type-exports': [\n\t\t\t'error',\n\t\t\t{ fixMixedExportsWithInlineTypeSpecifier: true },\n\t\t],\n\t\t'@typescript-eslint/no-unnecessary-qualifier': 'error',\n\t\t'@typescript-eslint/no-useless-default-assignment': 'error',\n\t\t'@typescript-eslint/parameter-properties': [\n\t\t\t'error',\n\t\t\t{ prefer: 'parameter-property' },\n\t\t],\n\t\t'@typescript-eslint/prefer-readonly': 'error',\n\t\t'perfectionist/sort-array-includes': ['error', { type: 'natural' }],\n\t\t'perfectionist/sort-classes': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\tgroups: ['property', 'constructor'],\n\t\t\t\ttype: 'natural',\n\t\t\t},\n\t\t],\n\t\t'perfectionist/sort-exports': ['error', { type: 'natural' }],\n\t\t'perfectionist/sort-imports': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\tcustomGroups: [\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'mock-side-effect',\n\t\t\t\t\t\telementNamePattern: '^.*/_*(mocks)_*/.*$',\n\t\t\t\t\t\tselector: 'side-effect',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'mock',\n\t\t\t\t\t\telementNamePattern: '^.*/_*(mocks)_*/.*$',\n\t\t\t\t\t\tselector: 'import',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tgroups: [\n\t\t\t\t\t'mock-side-effect',\n\t\t\t\t\t'mock',\n\t\t\t\t\t['type-builtin', 'type-external'],\n\t\t\t\t\t'type-internal',\n\t\t\t\t\t['type-parent', 'type-sibling', 'type-index'],\n\t\t\t\t\t['value-builtin', 'value-external'],\n\t\t\t\t\t'value-internal',\n\t\t\t\t\t['value-parent', 'value-sibling', 'value-index'],\n\t\t\t\t\t'unknown',\n\t\t\t\t\t'style',\n\t\t\t\t\t'side-effect',\n\t\t\t\t\t'side-effect-style',\n\t\t\t\t],\n\t\t\t\tinternalPattern: ['^(#|@/).*'],\n\t\t\t\tnewlinesBetween: 0,\n\t\t\t\tsortSideEffects: true,\n\t\t\t\ttype: 'natural',\n\t\t\t},\n\t\t],\n\t\t'perfectionist/sort-interfaces': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\tgroups: ['index-signature', 'unknown', 'method'],\n\t\t\t\ttype: 'natural',\n\t\t\t},\n\t\t],\n\t\t'perfectionist/sort-intersection-types': ['error', { type: 'natural' }],\n\t\t'perfectionist/sort-named-exports': ['error', { type: 'natural' }],\n\t\t'perfectionist/sort-named-imports': ['error', { type: 'natural' }],\n\t\t'perfectionist/sort-object-types': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\tgroups: ['index-signature', 'unknown', 'method'],\n\t\t\t\ttype: 'natural',\n\t\t\t},\n\t\t],\n\t\t'perfectionist/sort-objects': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\ttype: 'natural',\n\t\t\t\tuseConfigurationIf: {\n\t\t\t\t\tobjectType: 'destructured',\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'unsorted',\n\t\t\t\tuseConfigurationIf: {\n\t\t\t\t\tobjectType: 'non-destructured',\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t\t'perfectionist/sort-union-types': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\tcustomGroups: [\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'false',\n\t\t\t\t\t\telementNamePattern: '^false$',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'never',\n\t\t\t\t\t\telementNamePattern: '^never$',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'react',\n\t\t\t\t\t\telementNamePattern: '^react.+',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tgroups: [\n\t\t\t\t\t'react',\n\t\t\t\t\t'unknown',\n\t\t\t\t\t'tuple',\n\t\t\t\t\t'false',\n\t\t\t\t\t'nullish',\n\t\t\t\t\t'never',\n\t\t\t\t],\n\t\t\t\ttype: 'natural',\n\t\t\t},\n\t\t],\n\t},\n};\n\nexport default config;\n","import type { LinterConfigEntry } from '../types/index.d.ts';\nimport pluginPerfectionist from 'eslint-plugin-perfectionist';\n\nconst config: LinterConfigEntry = {\n\tname: 'Config Files',\n\tplugins: {\n\t\tperfectionist: pluginPerfectionist,\n\t},\n\trules: {\n\t\t'perfectionist/sort-objects': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\tcustomGroups: [\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'extends',\n\t\t\t\t\t\telementNamePattern: '^extends$',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'files',\n\t\t\t\t\t\telementNamePattern: '^files$',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'ignores',\n\t\t\t\t\t\telementNamePattern: '^(ignores|ignorePatterns)$',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'name',\n\t\t\t\t\t\telementNamePattern: '^(name|groupName)$',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'overrides',\n\t\t\t\t\t\telementNamePattern: '^overrides$',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'parser',\n\t\t\t\t\t\telementNamePattern: '^parser$',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'plugins',\n\t\t\t\t\t\telementNamePattern: '^plugins$',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'rules',\n\t\t\t\t\t\telementNamePattern: '^rules$',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tgroups: [\n\t\t\t\t\t'name',\n\t\t\t\t\t'files',\n\t\t\t\t\t'extends',\n\t\t\t\t\t'ignores',\n\t\t\t\t\t'plugins',\n\t\t\t\t\t'parser',\n\t\t\t\t\t'unknown',\n\t\t\t\t\t'rules',\n\t\t\t\t\t'overrides',\n\t\t\t\t],\n\t\t\t\tnewlinesBetween: 0,\n\t\t\t\ttype: 'natural',\n\t\t\t},\n\t\t],\n\t},\n};\n\nexport default config;\n","import type { ESLint } from 'eslint';\nimport type { LinterConfigEntry } from '../types/index.d.ts';\nimport pluginPerfectionist from 'eslint-plugin-perfectionist';\nimport pluginReact from 'eslint-plugin-react';\nimport pluginReactHooks from 'eslint-plugin-react-hooks';\n\n/**\n * This config is intentionally limited to rules not supported by Oxlint\n * and formatting options not supported by Prettier.\n */\nconst config: LinterConfigEntry = {\n\tname: 'React',\n\tplugins: {\n\t\t'perfectionist': pluginPerfectionist,\n\t\t'react': pluginReact,\n\t\t'react-hooks': pluginReactHooks as ESLint.Plugin,\n\t},\n\tsettings: {\n\t\treact: {\n\t\t\tversion: 'detect',\n\t\t},\n\t},\n\trules: {\n\t\t'perfectionist/sort-jsx-props': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\tcustomGroups: [\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'as',\n\t\t\t\t\t\telementNamePattern: '^as$',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'callback',\n\t\t\t\t\t\telementNamePattern: '^on.+',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'children',\n\t\t\t\t\t\telementNamePattern: '^children$',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'key',\n\t\t\t\t\t\telementNamePattern: '^key$',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'ref',\n\t\t\t\t\t\telementNamePattern: '^ref$',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'unsafe',\n\t\t\t\t\t\telementNamePattern: '^dangerously.+',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tgroups: [\n\t\t\t\t\t'key',\n\t\t\t\t\t'ref',\n\t\t\t\t\t'as',\n\t\t\t\t\t'unknown',\n\t\t\t\t\t'shorthand-prop',\n\t\t\t\t\t'callback',\n\t\t\t\t\t'children',\n\t\t\t\t\t'unsafe',\n\t\t\t\t],\n\t\t\t\ttype: 'unsorted',\n\t\t\t},\n\t\t],\n\t\t'react/destructuring-assignment': ['error', 'always'],\n\t\t'react/function-component-definition': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\tnamedComponents: ['arrow-function', 'function-declaration'],\n\t\t\t\tunnamedComponents: 'arrow-function',\n\t\t\t},\n\t\t],\n\t\t'react/hook-use-state': 'error',\n\t\t'react/jsx-no-constructed-context-values': 'error',\n\t\t'react/no-adjacent-inline-elements': 'error',\n\t\t'react/no-unstable-nested-components': 'error',\n\n\t\t// Enforce all `react-hooks` rules as errors\n\t\t...Object.fromEntries(\n\t\t\tObject.keys(\n\t\t\t\tpluginReactHooks.configs.flat['recommended-latest'].rules\n\t\t\t).map((rule) => [rule, 'error'])\n\t\t),\n\t},\n};\n\nexport default config;\n","import type { LinterConfigEntry } from '../types/index.d.ts';\nimport { includeIgnoreFile as _includeIgnoreFile } from '@eslint/compat';\nimport fs from 'node:fs';\nimport path from 'node:path';\n\nconst configPath = path.resolve('.gitignore');\nconst configExists = fs.existsSync(configPath);\n\nconst config: LinterConfigEntry = configExists\n\t? _includeIgnoreFile(configPath, '.gitignore')\n\t: {};\n\nexport default config;\n","import type { Config } from 'eslint/config';\nimport type { StandardConfig, StandardConfigArray } from '../types/index.d.ts';\nimport pluginOxlint from 'eslint-plugin-oxlint';\nimport { defineConfig as eslintDefineConfig } from 'eslint/config';\nimport configBase from '../config-base/index.ts';\nimport configConfigFiles from '../config-config-files/index.ts';\nimport configIgnores from '../config-ignores/index.ts';\nimport configReact from '../config-react/index.ts';\n\n/**\n * Combine Standard Config with optional additional config.\n */\nexport default function defineConfig(\n\t...configs: StandardConfigArray\n): Config[] {\n\treturn eslintDefineConfig({\n\t\tname: 'Standard Config',\n\t\tfiles: ['**/*.{ts,tsx,cts,mts}'],\n\t\textends: [\n\t\t\tconfigIgnores,\n\t\t\tconfigBase,\n\t\t\t{\n\t\t\t\tfiles: ['**/*.config.{ts,cts,mts}'],\n\t\t\t\t...configConfigFiles,\n\t\t\t},\n\t\t\t...normalizeExtensionConfigs(configs),\n\t\t\tpluginOxlint.configs['flat/all'],\n\t\t],\n\t});\n}\n\nfunction normalizeExtensionConfigs(configs: StandardConfigArray) {\n\tconst configArray = configs.flat();\n\tconst extensions: Array<Config | Config[]> = [];\n\n\tif (configArray.length === 0) {\n\t\treturn extensions;\n\t}\n\n\tif ((configArray[0] as StandardConfig).react) {\n\t\textensions.push(configReact);\n\t}\n\n\textensions.push(\n\t\teslintDefineConfig(\n\t\t\t// Ensure `react` doesn’t break the expected config structure\n\t\t\tconfigArray.map((configEntry) => {\n\t\t\t\tif (Array.isArray(configEntry)) {\n\t\t\t\t\treturn configEntry;\n\t\t\t\t}\n\n\t\t\t\t/* oxlint-disable-next-line eslint/no-unused-vars */\n\t\t\t\tconst { react, ...config } = configEntry as StandardConfig;\n\t\t\t\treturn config;\n\t\t\t})\n\t\t)\n\t);\n\n\treturn extensions;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAQA,MAAM,SAA4B;CACjC,MAAM;CACN,SAAS;EACR,sBAAsB,SAAS;EAC/B,iBAAiB;EACjB;CACD,iBAAiB;EAChB,QAAQ,SAAS;EACjB,eAAe,EACd,gBAAgB,MAChB;EACD;CACD,eAAe;EACd,+BAA+B;EAC/B,2BAA2B;EAC3B;CACD,OAAO;EAGL,aAAa,CAAC,SAAS,EAAE,YAAY,UAAU,CAAC;EAChD,gBAAgB;EAChB,sBAAsB;GACrB;GACA;GACA,EAAE,4BAA4B,MAAM;GACpC;EAEF,iDAAiD,CAChD,SACA;GACC,gBAAgB;GAChB,6BAA6B;GA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AAoB;KACpB;IACD;KACC,WAAW;KACX,oBAAoB;KACpB;IACD;KACC,WAAW;KACX,oBAAoB;KACpB;IACD;GACD,QAAQ;IACP;IACA;IACA;IACA;IACA;IACA;IACA;GACD,MAAM;GACN,CACD;EACD;CACD;;;;AC3JD,MAAMA,WAA4B;CACjC,MAAM;CACN,SAAS,EACR,eAAe,qBACf;CACD,OAAO,EACN,8BAA8B,CAC7B,SACA;EACC,cAAc;GACb;IACC,WAAW;IACX,oBAAoB;IACpB;GACD;IACC,WAAW;IACX,oBAAoB;IACpB;GACD;IACC,WAAW;IACX,oBAAoB;IACpB;GACD;IACC,WAAW;IACX,oBAAoB;IACpB;GACD;IACC,WAAW;IACX,oBAAoB;IACpB;GACD;IACC,WAAW;IACX,oBAAoB;IACpB;GACD;IACC,WAAW;IACX,oBAAoB;IACpB;GACD;IACC,WAAW;IACX,oBAAoB;IACpB;GACD;EACD,QAAQ;GACP;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACD,iBAAiB;EACjB,MAAM;EACN,CACD,EACD;CACD;;;;;;;;ACpDD,MAAMC,WAA4B;CACjC,MAAM;CACN,SAAS;EACR,iBAAiB;EACjB,SAAS;EACT,eAAe;EACf;CACD,UAAU,EACT,OAAO,EACN,SAAS,UACT,EACD;CACD,OAAO;EACN,gCAAgC,CAC/B,SACA;GACC,cAAc;IACb;KACC,WAAW;KACX,oBAAoB;KACpB;IACD;KACC,WAAW;KACX,oBAAoB;KACpB;IACD;KACC,WAAW;KACX,oBAAoB;KACpB;IACD;KACC,WAAW;KACX,oBAAoB;KACpB;IACD;KACC,WAAW;KACX,oBAAoB;KACpB;IACD;KACC,WAAW;KACX,oBAAoB;KACpB;IACD;GACD,QAAQ;IACP;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACD,MAAM;GACN,CACD;EACD,kCAAkC,CAAC,SAAS,SAAS;EACrD,uCAAuC,CACtC,SACA;GACC,iBAAiB,CAAC,kBAAkB,uBAAuB;GAC3D,mBAAmB;GACnB,CACD;EACD,wBAAwB;EACxB,2CAA2C;EAC3C,qCAAqC;EACrC,uCAAuC;EAGvC,GAAG,OAAO,YACT,OAAO,KACN,iBAAiB,QAAQ,KAAK,sBAAsB,MACpD,CAAC,KAAK,SAAS,CAAC,MAAM,QAAQ,CAAC,CAChC;EACD;CACD;;;;AChFD,MAAM,aAAa,KAAK,QAAQ,aAAa;AAG7C,MAAMC,WAFe,GAAG,WAAW,WAAW,GAG3CC,kBAAmB,YAAY,aAAa,GAC5C,EAAE;;;;;;;ACEL,SAAwB,aACvB,GAAG,SACQ;AACX,QAAOC,eAAmB;EACzB,MAAM;EACN,OAAO,CAAC,wBAAwB;EAChC,SAAS;GACRC;GACAC;GACA;IACC,OAAO,CAAC,2BAA2B;IACnC,GAAGC;IACH;GACD,GAAG,0BAA0B,QAAQ;GACrC,aAAa,QAAQ;GACrB;EACD,CAAC;;AAGH,SAAS,0BAA0B,SAA8B;CAChE,MAAM,cAAc,QAAQ,MAAM;CAClC,MAAM,aAAuC,EAAE;AAE/C,KAAI,YAAY,WAAW,EAC1B,QAAO;AAGR,KAAK,YAAY,GAAsB,MACtC,YAAW,KAAKC,SAAY;AAG7B,YAAW,KACVJ,eAEC,YAAY,KAAK,gBAAgB;AAChC,MAAI,MAAM,QAAQ,YAAY,CAC7B,QAAO;EAIR,MAAM,EAAE,OAAO,GAAG,WAAW;AAC7B,SAAO;GACN,CACF,CACD;AAED,QAAO"}
1
+ {"version":3,"file":"index.mjs","names":["config","config","config","eslintDefineConfig","configIgnores","configBase","configConfigFiles","configReact"],"sources":["../src/config-base/index.ts","../src/config-config-files/index.ts","../src/config-react/index.ts","../src/config-ignores/index.ts","../src/define-config/index.ts"],"sourcesContent":["import type { LinterConfigEntry } from '../types/index.d.ts';\nimport pluginPerfectionist from 'eslint-plugin-perfectionist';\nimport tseslint from 'typescript-eslint';\n\n/**\n * This config is intentionally limited to rules not supported by Oxlint\n * and formatting options not supported by Prettier.\n */\nconst config: LinterConfigEntry = {\n\tname: 'Base Config',\n\tplugins: {\n\t\t'@typescript-eslint': tseslint.plugin,\n\t\t'perfectionist': pluginPerfectionist,\n\t},\n\tlanguageOptions: {\n\t\tparser: tseslint.parser,\n\t\tparserOptions: {\n\t\t\tprojectService: true,\n\t\t\twarnOnUnsupportedTypeScriptVersion: false,\n\t\t},\n\t},\n\tlinterOptions: {\n\t\treportUnusedDisableDirectives: 'error',\n\t\treportUnusedInlineConfigs: 'error',\n\t},\n\trules: {\n\t\t/* oxlint-disable-next-line unicorn/no-useless-spread */\n\t\t...{\n\t\t\t'camelcase': ['error', { properties: 'always' }],\n\t\t\t'dot-notation': 'error',\n\t\t\t'func-name-matching': [\n\t\t\t\t'error',\n\t\t\t\t'never',\n\t\t\t\t{ considerPropertyDescriptor: true },\n\t\t\t],\n\t\t},\n\t\t'@typescript-eslint/consistent-type-assertions': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\tassertionStyle: 'as',\n\t\t\t\tobjectLiteralTypeAssertions: 'allow-as-parameter',\n\t\t\t},\n\t\t],\n\t\t'@typescript-eslint/consistent-type-exports': [\n\t\t\t'error',\n\t\t\t{ fixMixedExportsWithInlineTypeSpecifier: true },\n\t\t],\n\t\t'@typescript-eslint/no-unnecessary-qualifier': 'error',\n\t\t'@typescript-eslint/no-useless-default-assignment': 'error',\n\t\t'@typescript-eslint/parameter-properties': [\n\t\t\t'error',\n\t\t\t{ prefer: 'parameter-property' },\n\t\t],\n\t\t'@typescript-eslint/prefer-readonly': 'error',\n\t\t'perfectionist/sort-array-includes': ['error', { type: 'natural' }],\n\t\t'perfectionist/sort-classes': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\tgroups: ['property', 'constructor'],\n\t\t\t\ttype: 'natural',\n\t\t\t},\n\t\t],\n\t\t'perfectionist/sort-exports': ['error', { type: 'natural' }],\n\t\t'perfectionist/sort-imports': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\tcustomGroups: [\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'mock-side-effect',\n\t\t\t\t\t\telementNamePattern: '^.*/_*(mocks)_*/.*$',\n\t\t\t\t\t\tselector: 'side-effect',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'mock',\n\t\t\t\t\t\telementNamePattern: '^.*/_*(mocks)_*/.*$',\n\t\t\t\t\t\tselector: 'import',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tgroups: [\n\t\t\t\t\t'mock-side-effect',\n\t\t\t\t\t'mock',\n\t\t\t\t\t['type-builtin', 'type-external'],\n\t\t\t\t\t'type-internal',\n\t\t\t\t\t['type-parent', 'type-sibling', 'type-index'],\n\t\t\t\t\t['value-builtin', 'value-external'],\n\t\t\t\t\t'value-internal',\n\t\t\t\t\t['value-parent', 'value-sibling', 'value-index'],\n\t\t\t\t\t'unknown',\n\t\t\t\t\t'style',\n\t\t\t\t\t'side-effect',\n\t\t\t\t\t'side-effect-style',\n\t\t\t\t],\n\t\t\t\tinternalPattern: ['^(#|@/).*'],\n\t\t\t\tnewlinesBetween: 0,\n\t\t\t\tsortSideEffects: true,\n\t\t\t\ttype: 'natural',\n\t\t\t},\n\t\t],\n\t\t'perfectionist/sort-interfaces': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\tgroups: ['index-signature', 'unknown', 'method'],\n\t\t\t\ttype: 'natural',\n\t\t\t},\n\t\t],\n\t\t'perfectionist/sort-intersection-types': ['error', { type: 'natural' }],\n\t\t'perfectionist/sort-named-exports': ['error', { type: 'natural' }],\n\t\t'perfectionist/sort-named-imports': ['error', { type: 'natural' }],\n\t\t'perfectionist/sort-object-types': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\tgroups: ['index-signature', 'unknown', 'method'],\n\t\t\t\ttype: 'natural',\n\t\t\t},\n\t\t],\n\t\t'perfectionist/sort-objects': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\ttype: 'natural',\n\t\t\t\tuseConfigurationIf: {\n\t\t\t\t\tobjectType: 'destructured',\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'unsorted',\n\t\t\t\tuseConfigurationIf: {\n\t\t\t\t\tobjectType: 'non-destructured',\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t\t'perfectionist/sort-union-types': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\tcustomGroups: [\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'false',\n\t\t\t\t\t\telementNamePattern: '^false$',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'never',\n\t\t\t\t\t\telementNamePattern: '^never$',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'react',\n\t\t\t\t\t\telementNamePattern: '^react.+',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tgroups: [\n\t\t\t\t\t'react',\n\t\t\t\t\t'unknown',\n\t\t\t\t\t'tuple',\n\t\t\t\t\t'false',\n\t\t\t\t\t'nullish',\n\t\t\t\t\t'never',\n\t\t\t\t],\n\t\t\t\ttype: 'natural',\n\t\t\t},\n\t\t],\n\t},\n};\n\nexport default config;\n","import type { LinterConfigEntry } from '../types/index.d.ts';\nimport pluginPerfectionist from 'eslint-plugin-perfectionist';\n\nconst config: LinterConfigEntry = {\n\tname: 'Config Files',\n\tplugins: {\n\t\tperfectionist: pluginPerfectionist,\n\t},\n\trules: {\n\t\t'perfectionist/sort-objects': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\tcustomGroups: [\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'extends',\n\t\t\t\t\t\telementNamePattern: '^extends$',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'files',\n\t\t\t\t\t\telementNamePattern: '^files$',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'ignores',\n\t\t\t\t\t\telementNamePattern: '^(ignores|ignorePatterns)$',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'name',\n\t\t\t\t\t\telementNamePattern: '^(name|groupName)$',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'overrides',\n\t\t\t\t\t\telementNamePattern: '^overrides$',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'parser',\n\t\t\t\t\t\telementNamePattern: '^parser$',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'plugins',\n\t\t\t\t\t\telementNamePattern: '^plugins$',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'rules',\n\t\t\t\t\t\telementNamePattern: '^rules$',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tgroups: [\n\t\t\t\t\t'name',\n\t\t\t\t\t'files',\n\t\t\t\t\t'extends',\n\t\t\t\t\t'ignores',\n\t\t\t\t\t'plugins',\n\t\t\t\t\t'parser',\n\t\t\t\t\t'unknown',\n\t\t\t\t\t'rules',\n\t\t\t\t\t'overrides',\n\t\t\t\t],\n\t\t\t\tnewlinesBetween: 0,\n\t\t\t\ttype: 'natural',\n\t\t\t},\n\t\t],\n\t},\n};\n\nexport default config;\n","import type { ESLint } from 'eslint';\nimport type { LinterConfigEntry } from '../types/index.d.ts';\nimport pluginPerfectionist from 'eslint-plugin-perfectionist';\nimport pluginReact from 'eslint-plugin-react';\nimport pluginReactHooks from 'eslint-plugin-react-hooks';\n\n/**\n * This config is intentionally limited to rules not supported by Oxlint\n * and formatting options not supported by Prettier.\n */\nconst config: LinterConfigEntry = {\n\tname: 'React',\n\tplugins: {\n\t\t'perfectionist': pluginPerfectionist,\n\t\t'react': pluginReact,\n\t\t'react-hooks': pluginReactHooks as ESLint.Plugin,\n\t},\n\tsettings: {\n\t\treact: {\n\t\t\tversion: 'detect',\n\t\t},\n\t},\n\trules: {\n\t\t'perfectionist/sort-jsx-props': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\tcustomGroups: [\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'as',\n\t\t\t\t\t\telementNamePattern: '^as$',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'callback',\n\t\t\t\t\t\telementNamePattern: '^on.+',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'children',\n\t\t\t\t\t\telementNamePattern: '^children$',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'key',\n\t\t\t\t\t\telementNamePattern: '^key$',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'ref',\n\t\t\t\t\t\telementNamePattern: '^ref$',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'unsafe',\n\t\t\t\t\t\telementNamePattern: '^dangerously.+',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tgroups: [\n\t\t\t\t\t'key',\n\t\t\t\t\t'ref',\n\t\t\t\t\t'as',\n\t\t\t\t\t'unknown',\n\t\t\t\t\t'shorthand-prop',\n\t\t\t\t\t'callback',\n\t\t\t\t\t'children',\n\t\t\t\t\t'unsafe',\n\t\t\t\t],\n\t\t\t\ttype: 'unsorted',\n\t\t\t},\n\t\t],\n\t\t'react/destructuring-assignment': ['error', 'always'],\n\t\t'react/function-component-definition': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\tnamedComponents: ['arrow-function', 'function-declaration'],\n\t\t\t\tunnamedComponents: 'arrow-function',\n\t\t\t},\n\t\t],\n\t\t'react/hook-use-state': 'error',\n\t\t'react/jsx-no-constructed-context-values': 'error',\n\t\t'react/no-adjacent-inline-elements': 'error',\n\t\t'react/no-unstable-nested-components': 'error',\n\n\t\t// Enforce all `react-hooks` rules as errors\n\t\t...Object.fromEntries(\n\t\t\tObject.keys(\n\t\t\t\tpluginReactHooks.configs.flat['recommended-latest'].rules\n\t\t\t).map((rule) => [rule, 'error'])\n\t\t),\n\t},\n};\n\nexport default config;\n","import type { LinterConfigEntry } from '../types/index.d.ts';\nimport { includeIgnoreFile } from '@eslint/compat';\nimport fs from 'node:fs';\nimport path from 'node:path';\n\nconst configPath = path.resolve('.gitignore');\nconst configExists = fs.existsSync(configPath);\n\nconst config: LinterConfigEntry = configExists\n\t? includeIgnoreFile(configPath, '.gitignore')\n\t: {};\n\nexport default config;\n","import type { Config } from 'eslint/config';\nimport type { StandardConfig, StandardConfigArray } from '../types/index.d.ts';\nimport pluginOxlint from 'eslint-plugin-oxlint';\nimport { defineConfig as eslintDefineConfig } from 'eslint/config';\nimport configBase from '../config-base/index.ts';\nimport configConfigFiles from '../config-config-files/index.ts';\nimport configIgnores from '../config-ignores/index.ts';\nimport configReact from '../config-react/index.ts';\n\n/**\n * Combine Standard Config with optional additional config.\n */\nexport default function defineConfig(\n\t...configs: StandardConfigArray\n): Config[] {\n\treturn eslintDefineConfig({\n\t\tname: 'Standard Config',\n\t\tfiles: ['**/*.{ts,tsx,cts,mts}'],\n\t\textends: [\n\t\t\tconfigIgnores,\n\t\t\tconfigBase,\n\t\t\t{\n\t\t\t\tfiles: ['**/*.config.{ts,cts,mts}'],\n\t\t\t\t...configConfigFiles,\n\t\t\t},\n\t\t\t...normalizeExtensionConfigs(configs),\n\t\t\tpluginOxlint.configs['flat/all'],\n\t\t],\n\t});\n}\n\nfunction normalizeExtensionConfigs(configs: StandardConfigArray) {\n\tconst configArray = configs.flat();\n\tconst extensions: Array<Config | Config[]> = [];\n\n\tif (configArray.length === 0) {\n\t\treturn extensions;\n\t}\n\n\tif ((configArray[0] as StandardConfig).react) {\n\t\textensions.push(configReact);\n\t}\n\n\textensions.push(\n\t\teslintDefineConfig(\n\t\t\t// Ensure `react` doesn’t break the expected config structure\n\t\t\tconfigArray.map((configEntry) => {\n\t\t\t\tif (Array.isArray(configEntry)) {\n\t\t\t\t\treturn configEntry;\n\t\t\t\t}\n\n\t\t\t\t/* oxlint-disable-next-line eslint/no-unused-vars */\n\t\t\t\tconst { react, ...config } = configEntry as StandardConfig;\n\t\t\t\treturn config;\n\t\t\t})\n\t\t)\n\t);\n\n\treturn extensions;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAQA,MAAM,SAA4B;CACjC,MAAM;CACN,SAAS;EACR,sBAAsB,SAAS;EAC/B,iBAAiB;EACjB;CACD,iBAAiB;EAChB,QAAQ,SAAS;EACjB,eAAe;GACd,gBAAgB;GAChB,oCAAoC;GACpC;EACD;CACD,eAAe;EACd,+BAA+B;EAC/B,2BAA2B;EAC3B;CACD,OAAO;EAGL,aAAa,CAAC,SAAS,EAAE,YAAY,UAAU,CAAC;EAChD,gBAAgB;EAChB,sBAAsB;GACrB;GACA;GACA,EAAE,4BAA4B,MAAM;GACpC;EAEF,iDAAiD,CAChD,SACA;GACC,gBAAgB;GAChB,6BAA6B;GAC7B,CACD;EACD,8CAA8C,CAC7C,SACA,EAAE,wCAAwC,MAAM,CAChD;EACD,+CAA+C;EAC/C,oDAAoD;EACpD,2CAA2C,CAC1C,SACA,EAAE,QAAQ,sBAAsB,CAChC;EACD,sCAAsC;EACtC,qCAAqC,CAAC,SAAS,EAAE,MAAM,WAAW,CAAC;EACnE,8BAA8B,CAC7B,SACA;GACC,QAAQ,CAAC,YAAY,cAAc;GACnC,MAAM;GACN,CACD;EACD,8BAA8B,CAAC,SAAS,EAAE,MAAM,WAAW,CAAC;EAC5D,8BAA8B,CAC7B,SACA;GACC,cAAc,CACb;IACC,WAAW;IACX,oBAAoB;IACpB,UAAU;IACV,EACD;IACC,WAAW;IACX,oBAAoB;IACpB,UAAU;IACV,CACD;GACD,QAAQ;IACP;IACA;IACA,CAAC,gBAAgB,gBAAgB;IACjC;IACA;KAAC;KAAe;KAAgB;KAAa;IAC7C,CAAC,iBAAiB,iBAAiB;IACnC;IACA;KAAC;KAAgB;KAAiB;KAAc;IAChD;IACA;IACA;IACA;IACA;GACD,iBAAiB,CAAC,YAAY;GAC9B,iBAAiB;GACjB,iBAAiB;GACjB,MAAM;GACN,CACD;EACD,iCAAiC,CAChC,SACA;GACC,QAAQ;IAAC;IAAmB;IAAW;IAAS;GAChD,MAAM;GACN,CACD;EACD,yCAAyC,CAAC,SAAS,EAAE,MAAM,WAAW,CAAC;EACvE,oCAAoC,CAAC,SAAS,EAAE,MAAM,WAAW,CAAC;EAClE,oCAAoC,CAAC,SAAS,EAAE,MAAM,WAAW,CAAC;EAClE,mCAAmC,CAClC,SACA;GACC,QAAQ;IAAC;IAAmB;IAAW;IAAS;GAChD,MAAM;GACN,CACD;EACD,8BAA8B;GAC7B;GACA;IACC,MAAM;IACN,oBAAoB,EACnB,YAAY,gBACZ;IACD;GACD;IACC,MAAM;IACN,oBAAoB,EACnB,YAAY,oBACZ;IACD;GACD;EACD,kCAAkC,CACjC,SACA;GACC,cAAc;IACb;KACC,WAAW;KACX,oBAAoB;KACpB;IACD;KACC,WAAW;KACX,oBAAoB;KACpB;IACD;KACC,WAAW;KACX,oBAAoB;KACpB;IACD;GACD,QAAQ;IACP;IACA;IACA;IACA;IACA;IACA;IACA;GACD,MAAM;GACN,CACD;EACD;CACD;;;;AC5JD,MAAMA,WAA4B;CACjC,MAAM;CACN,SAAS,EACR,eAAe,qBACf;CACD,OAAO,EACN,8BAA8B,CAC7B,SACA;EACC,cAAc;GACb;IACC,WAAW;IACX,oBAAoB;IACpB;GACD;IACC,WAAW;IACX,oBAAoB;IACpB;GACD;IACC,WAAW;IACX,oBAAoB;IACpB;GACD;IACC,WAAW;IACX,oBAAoB;IACpB;GACD;IACC,WAAW;IACX,oBAAoB;IACpB;GACD;IACC,WAAW;IACX,oBAAoB;IACpB;GACD;IACC,WAAW;IACX,oBAAoB;IACpB;GACD;IACC,WAAW;IACX,oBAAoB;IACpB;GACD;EACD,QAAQ;GACP;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACD,iBAAiB;EACjB,MAAM;EACN,CACD,EACD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I,YAAY,WAAW,EAC1B,QAAO;AAGR,KAAK,YAAY,GAAsB,MACtC,YAAW,KAAKC,SAAY;AAG7B,YAAW,KACVJ,eAEC,YAAY,KAAK,gBAAgB;AAChC,MAAI,MAAM,QAAQ,YAAY,CAC7B,QAAO;EAIR,MAAM,EAAE,OAAO,GAAG,WAAW;AAC7B,SAAO;GACN,CACF,CACD;AAED,QAAO"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@standard-config/eslint",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "TypeScript-first ESLint config designed to complement Oxlint",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -52,21 +52,21 @@
52
52
  }
53
53
  },
54
54
  "devDependencies": {
55
- "@standard-config/oxlint": "1.1.0",
56
- "@standard-config/prettier": "1.9.1",
57
- "@standard-config/tsconfig": "2.0.2",
58
- "@types/node": "22.19.11",
59
- "@vitest/coverage-v8": "4.0.18",
60
- "eslint": "10.0.0",
61
- "husky": "9.1.7",
62
- "jiti": "2.6.1",
63
- "oxlint": "1.46.0",
64
- "oxlint-tsgolint": "0.11.5",
65
- "prettier": "3.8.1",
66
- "publint": "0.3.17",
67
- "tsdown": "0.20.3",
68
- "typescript": "5.9.3",
69
- "vitest": "4.0.18"
55
+ "@standard-config/oxlint": "^1.1.1",
56
+ "@standard-config/prettier": "^1.9.1",
57
+ "@standard-config/tsconfig": "^2.0.2",
58
+ "@types/node": "^22.19.11",
59
+ "@vitest/coverage-v8": "^4.0.18",
60
+ "eslint": "^10.0.0",
61
+ "husky": "^9.1.7",
62
+ "jiti": "^2.6.1",
63
+ "oxlint": "^1.46.0",
64
+ "oxlint-tsgolint": "^0.12.0",
65
+ "prettier": "^3.8.1",
66
+ "publint": "^0.3.17",
67
+ "tsdown": "^0.20.3",
68
+ "typescript": "^5.9.3",
69
+ "vitest": "^4.0.18"
70
70
  },
71
71
  "scripts": {
72
72
  "build": "tsdown",