@standard-config/eslint 1.5.0 → 1.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +4 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -6
package/dist/index.mjs
CHANGED
|
@@ -35,7 +35,6 @@ const config = {
|
|
|
35
35
|
},
|
|
36
36
|
rules: {
|
|
37
37
|
"camelcase": ["error", { properties: "always" }],
|
|
38
|
-
"dot-notation": "error",
|
|
39
38
|
"func-name-matching": [
|
|
40
39
|
"error",
|
|
41
40
|
"never",
|
|
@@ -118,10 +117,8 @@ const config = {
|
|
|
118
117
|
line: { markers: ["/"] }
|
|
119
118
|
}
|
|
120
119
|
],
|
|
121
|
-
"@typescript-eslint/consistent-type-exports": ["error", { fixMixedExportsWithInlineTypeSpecifier: true }],
|
|
122
120
|
"@typescript-eslint/no-unnecessary-qualifier": "error",
|
|
123
121
|
"@typescript-eslint/no-useless-default-assignment": "error",
|
|
124
|
-
"@typescript-eslint/parameter-properties": ["error", { prefer: "parameter-property" }],
|
|
125
122
|
"@typescript-eslint/prefer-readonly": "error",
|
|
126
123
|
"perfectionist/sort-array-includes": ["error", { type: "natural" }],
|
|
127
124
|
"perfectionist/sort-classes": ["error", {
|
|
@@ -400,7 +397,10 @@ function normalizeExtensionConfigs(configs) {
|
|
|
400
397
|
const configArray = configs.flat();
|
|
401
398
|
const extensions = [];
|
|
402
399
|
if (configArray.length === 0) return extensions;
|
|
403
|
-
if (configArray[0].react) extensions.push(
|
|
400
|
+
if (configArray[0].react) extensions.push({
|
|
401
|
+
files: ["**/*.tsx"],
|
|
402
|
+
...config$2
|
|
403
|
+
});
|
|
404
404
|
extensions.push(defineConfig$1(configArray.map((configEntry) => {
|
|
405
405
|
if (Array.isArray(configEntry)) return configEntry;
|
|
406
406
|
const { react, ...config } = configEntry;
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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 pluginStylistic from '@stylistic/eslint-plugin';\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'@stylistic': pluginStylistic,\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'@stylistic/lines-between-class-members': [\n\t\t\t'error',\n\t\t\t'always',\n\t\t\t{ exceptAfterSingleLine: true },\n\t\t],\n\t\t'@stylistic/padding-line-between-statements': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\tblankLine: 'always',\n\t\t\t\tnext: '*',\n\t\t\t\tprev: [\n\t\t\t\t\t'block-like',\n\t\t\t\t\t'directive',\n\t\t\t\t\t'export',\n\t\t\t\t\t'function',\n\t\t\t\t\t'import',\n\t\t\t\t\t'interface',\n\t\t\t\t\t'type',\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\tblankLine: 'always',\n\t\t\t\tnext: [\n\t\t\t\t\t'block-like',\n\t\t\t\t\t'directive',\n\t\t\t\t\t'export',\n\t\t\t\t\t'function',\n\t\t\t\t\t'import',\n\t\t\t\t\t'interface',\n\t\t\t\t\t'type',\n\t\t\t\t],\n\t\t\t\tprev: '*',\n\t\t\t},\n\t\t\t{\n\t\t\t\tblankLine: 'always',\n\t\t\t\tnext: '*',\n\t\t\t\tprev: ['case', 'default'],\n\t\t\t},\n\t\t\t{\n\t\t\t\tblankLine: 'never',\n\t\t\t\tnext: 'directive',\n\t\t\t\tprev: 'directive',\n\t\t\t},\n\t\t\t{\n\t\t\t\tblankLine: 'any',\n\t\t\t\tnext: 'export',\n\t\t\t\tprev: 'export',\n\t\t\t},\n\t\t\t{\n\t\t\t\tblankLine: 'never',\n\t\t\t\tnext: ['function', 'function-overload'],\n\t\t\t\tprev: 'function-overload',\n\t\t\t},\n\t\t\t{\n\t\t\t\tblankLine: 'never',\n\t\t\t\tnext: 'import',\n\t\t\t\tprev: 'import',\n\t\t\t},\n\t\t\t{\n\t\t\t\tblankLine: 'any',\n\t\t\t\tnext: 'interface',\n\t\t\t\tprev: 'interface',\n\t\t\t},\n\t\t\t{\n\t\t\t\tblankLine: 'any',\n\t\t\t\tnext: 'type',\n\t\t\t\tprev: 'type',\n\t\t\t},\n\t\t],\n\t\t'@stylistic/spaced-comment': [\n\t\t\t'error',\n\t\t\t'always',\n\t\t\t{\n\t\t\t\tblock: {\n\t\t\t\t\tbalanced: true,\n\t\t\t\t},\n\t\t\t\tline: {\n\t\t\t\t\tmarkers: ['/'],\n\t\t\t\t},\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';\nimport pluginReactNamingConvention from 'eslint-plugin-react-naming-convention';\nimport pluginReactX from 'eslint-plugin-react-x';\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\t'react-naming-convention': pluginReactNamingConvention,\n\t\t'react-x': pluginReactX,\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-naming-convention/component-name': 'error',\n\t\t'react-naming-convention/context-name': 'error',\n\t\t'react-naming-convention/ref-name': 'error',\n\t\t'react-naming-convention/use-state': 'error',\n\t\t'react-x/jsx-dollar': 'error',\n\t\t'react-x/jsx-key-before-spread': 'error',\n\t\t'react-x/jsx-no-iife': 'error',\n\t\t'react-x/no-access-state-in-setstate': 'error',\n\t\t'react-x/no-class-component': 'error',\n\t\t'react-x/no-context-provider': 'error',\n\t\t'react-x/no-default-props': 'error',\n\t\t'react-x/no-duplicate-key': 'error',\n\t\t'react-x/no-forward-ref': 'error',\n\t\t'react-x/no-implicit-key': 'error',\n\t\t'react-x/no-leaked-conditional-rendering': 'error',\n\t\t'react-x/no-misused-capture-owner-stack': 'error',\n\t\t'react-x/no-nested-component-definitions': 'error',\n\t\t'react-x/no-nested-lazy-component-declarations': 'error',\n\t\t'react-x/no-prop-types': 'error',\n\t\t'react-x/no-unnecessary-use-callback': 'error',\n\t\t'react-x/no-unnecessary-use-memo': 'error',\n\t\t'react-x/no-unstable-context-value': 'error',\n\t\t'react-x/no-unstable-default-props': 'error',\n\t\t'react-x/no-use-context': 'error',\n\t\t'react-x/prefer-destructuring-assignment': 'error',\n\t\t'react-x/prefer-use-state-lazy-initialization': 'error',\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/no-adjacent-inline-elements': '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)\n\t\t\t\t.filter(\n\t\t\t\t\t(rule) =>\n\t\t\t\t\t\t![\n\t\t\t\t\t\t\t'react-hooks/exhaustive-deps',\n\t\t\t\t\t\t\t'react-hooks/rules-of-hooks',\n\t\t\t\t\t\t].includes(rule)\n\t\t\t\t)\n\t\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 { 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],\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":";;;;;;;;;;;;;;;;;AASA,MAAM,SAA4B;CACjC,MAAM;CACN,SAAS;EACR,cAAc;EACd,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,0CAA0C;GACzC;GACA;GACA,EAAE,uBAAuB,MAAM;GAC/B;EACD,8CAA8C;GAC7C;GACA;IACC,WAAW;IACX,MAAM;IACN,MAAM;KACL;KACA;KACA;KACA;KACA;KACA;KACA;KACA;IACD;GACD;IACC,WAAW;IACX,MAAM;KACL;KACA;KACA;KACA;KACA;KACA;KACA;KACA;IACD,MAAM;IACN;GACD;IACC,WAAW;IACX,MAAM;IACN,MAAM,CAAC,QAAQ,UAAU;IACzB;GACD;IACC,WAAW;IACX,MAAM;IACN,MAAM;IACN;GACD;IACC,WAAW;IACX,MAAM;IACN,MAAM;IACN;GACD;IACC,WAAW;IACX,MAAM,CAAC,YAAY,oBAAoB;IACvC,MAAM;IACN;GACD;IACC,WAAW;IACX,MAAM;IACN,MAAM;IACN;GACD;IACC,WAAW;IACX,MAAM;IACN,MAAM;IACN;GACD;IACC,WAAW;IACX,MAAM;IACN,MAAM;IACN;GACD;EACD,6BAA6B;GAC5B;GACA;GACA;IACC,OAAO,EAC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CAAkC,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;;;;ACxOD,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;;;;;;;;AClDD,MAAMC,WAA4B;CACjC,MAAM;CACN,SAAS;EACR,iBAAiB;EACjB,SAAS;EACT,eAAe;EACf,2BAA2B;EAC3B,WAAW;EACX;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,0CAA0C;EAC1C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AAQ,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 pluginStylistic from '@stylistic/eslint-plugin';\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'@stylistic': pluginStylistic,\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'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'@stylistic/lines-between-class-members': [\n\t\t\t'error',\n\t\t\t'always',\n\t\t\t{ exceptAfterSingleLine: true },\n\t\t],\n\t\t'@stylistic/padding-line-between-statements': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\tblankLine: 'always',\n\t\t\t\tnext: '*',\n\t\t\t\tprev: [\n\t\t\t\t\t'block-like',\n\t\t\t\t\t'directive',\n\t\t\t\t\t'export',\n\t\t\t\t\t'function',\n\t\t\t\t\t'import',\n\t\t\t\t\t'interface',\n\t\t\t\t\t'type',\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\tblankLine: 'always',\n\t\t\t\tnext: [\n\t\t\t\t\t'block-like',\n\t\t\t\t\t'directive',\n\t\t\t\t\t'export',\n\t\t\t\t\t'function',\n\t\t\t\t\t'import',\n\t\t\t\t\t'interface',\n\t\t\t\t\t'type',\n\t\t\t\t],\n\t\t\t\tprev: '*',\n\t\t\t},\n\t\t\t{\n\t\t\t\tblankLine: 'always',\n\t\t\t\tnext: '*',\n\t\t\t\tprev: ['case', 'default'],\n\t\t\t},\n\t\t\t{\n\t\t\t\tblankLine: 'never',\n\t\t\t\tnext: 'directive',\n\t\t\t\tprev: 'directive',\n\t\t\t},\n\t\t\t{\n\t\t\t\tblankLine: 'any',\n\t\t\t\tnext: 'export',\n\t\t\t\tprev: 'export',\n\t\t\t},\n\t\t\t{\n\t\t\t\tblankLine: 'never',\n\t\t\t\tnext: ['function', 'function-overload'],\n\t\t\t\tprev: 'function-overload',\n\t\t\t},\n\t\t\t{\n\t\t\t\tblankLine: 'never',\n\t\t\t\tnext: 'import',\n\t\t\t\tprev: 'import',\n\t\t\t},\n\t\t\t{\n\t\t\t\tblankLine: 'any',\n\t\t\t\tnext: 'interface',\n\t\t\t\tprev: 'interface',\n\t\t\t},\n\t\t\t{\n\t\t\t\tblankLine: 'any',\n\t\t\t\tnext: 'type',\n\t\t\t\tprev: 'type',\n\t\t\t},\n\t\t],\n\t\t'@stylistic/spaced-comment': [\n\t\t\t'error',\n\t\t\t'always',\n\t\t\t{\n\t\t\t\tblock: {\n\t\t\t\t\tbalanced: true,\n\t\t\t\t},\n\t\t\t\tline: {\n\t\t\t\t\tmarkers: ['/'],\n\t\t\t\t},\n\t\t\t},\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/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';\nimport pluginReactNamingConvention from 'eslint-plugin-react-naming-convention';\nimport pluginReactX from 'eslint-plugin-react-x';\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\t'react-naming-convention': pluginReactNamingConvention,\n\t\t'react-x': pluginReactX,\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-naming-convention/component-name': 'error',\n\t\t'react-naming-convention/context-name': 'error',\n\t\t'react-naming-convention/ref-name': 'error',\n\t\t'react-naming-convention/use-state': 'error',\n\t\t'react-x/jsx-dollar': 'error',\n\t\t'react-x/jsx-key-before-spread': 'error',\n\t\t'react-x/jsx-no-iife': 'error',\n\t\t'react-x/no-access-state-in-setstate': 'error',\n\t\t'react-x/no-class-component': 'error',\n\t\t'react-x/no-context-provider': 'error',\n\t\t'react-x/no-default-props': 'error',\n\t\t'react-x/no-duplicate-key': 'error',\n\t\t'react-x/no-forward-ref': 'error',\n\t\t'react-x/no-implicit-key': 'error',\n\t\t'react-x/no-leaked-conditional-rendering': 'error',\n\t\t'react-x/no-misused-capture-owner-stack': 'error',\n\t\t'react-x/no-nested-component-definitions': 'error',\n\t\t'react-x/no-nested-lazy-component-declarations': 'error',\n\t\t'react-x/no-prop-types': 'error',\n\t\t'react-x/no-unnecessary-use-callback': 'error',\n\t\t'react-x/no-unnecessary-use-memo': 'error',\n\t\t'react-x/no-unstable-context-value': 'error',\n\t\t'react-x/no-unstable-default-props': 'error',\n\t\t'react-x/no-use-context': 'error',\n\t\t'react-x/prefer-destructuring-assignment': 'error',\n\t\t'react-x/prefer-use-state-lazy-initialization': 'error',\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/no-adjacent-inline-elements': '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)\n\t\t\t\t.filter(\n\t\t\t\t\t(rule) =>\n\t\t\t\t\t\t![\n\t\t\t\t\t\t\t'react-hooks/exhaustive-deps',\n\t\t\t\t\t\t\t'react-hooks/rules-of-hooks',\n\t\t\t\t\t\t].includes(rule)\n\t\t\t\t)\n\t\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 { 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],\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({\n\t\t\tfiles: ['**/*.tsx'],\n\t\t\t...configReact,\n\t\t});\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":";;;;;;;;;;;;;;;;;AASA,MAAM,SAA4B;CACjC,MAAM;CACN,SAAS;EACR,cAAc;EACd,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,sBAAsB;GACrB;GACA;GACA,EAAE,4BAA4B,MAAM;GACpC;EAEF,0CAA0C;GACzC;GACA;GACA,EAAE,uBAAuB,MAAM;GAC/B;EACD,8CAA8C;GAC7C;GACA;IACC,WAAW;IACX,MAAM;IACN,MAAM;KACL;KACA;KACA;KACA;KACA;KACA;KACA;KACA;IACD;GACD;IACC,WAAW;IACX,MAAM;KACL;KACA;KACA;KACA;KACA;KACA;KACA;KACA;IACD,MAAM;IACN;GACD;IACC,WAAW;IACX,MAAM;IACN,MAAM,CAAC,QAAQ,UAAU;IACzB;GACD;IACC,WAAW;IACX,MAAM;IACN,MAAM;IACN;GACD;IACC,WAAW;IACX,MAAM;IACN,MAAM;IACN;GACD;IACC,WAAW;IACX,MAAM,CAAC,YAAY,oBAAoB;IACvC,MAAM;IACN;GACD;IACC,WAAW;IACX,MAAM;IACN,MAAM;IACN;GACD;IACC,WAAW;IACX,MAAM;IACN,MAAM;IACN;GACD;IACC,WAAW;IACX,MAAM;IACN,MAAM;IACN;GACD;EACD,6BAA6B;GAC5B;GACA;GACA;IACC,OAAO,EACN,UAAU,MACV;IACD,MAAM,EACL,SAAS,CAA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QAAQ;IACP;IACA;IACA;IACA;IACA;IACA;IACA;GACD,MAAM;GACN,CACD;EACD;CACD;;;;AC/ND,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;;;;;;;;AClDD,MAAMC,WAA4B;CACjC,MAAM;CACN,SAAS;EACR,iBAAiB;EACjB,SAAS;EACT,eAAe;EACf,2BAA2B;EAC3B,WAAW;EACX;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,0CAA0C;EAC1C,wCAAwC;EACxC,oCAAoC;EACpC,qCAAqC;EACrC,sBAAsB;EACtB,iCAAiC;EACjC,uBAAuB;EACvB,uCAAuC;EACvC,8BAA8B;EAC9B,+BAA+B;EAC/B,4BAA4B;E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package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@standard-config/eslint",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.2",
|
|
4
4
|
"description": "TypeScript-first ESLint config designed to complement Oxlint",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@eslint/compat": "^2.0.2",
|
|
38
|
-
"@stylistic/eslint-plugin": "^5.
|
|
39
|
-
"eslint-plugin-perfectionist": "^5.
|
|
38
|
+
"@stylistic/eslint-plugin": "^5.9.0",
|
|
39
|
+
"eslint-plugin-perfectionist": "^5.6.0",
|
|
40
40
|
"eslint-plugin-react": "^7.37.5",
|
|
41
41
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
42
42
|
"eslint-plugin-react-naming-convention": "^2.13.0",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
}
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@standard-config/oxlint": "^1.1.
|
|
57
|
+
"@standard-config/oxlint": "^1.1.6",
|
|
58
58
|
"@standard-config/prettier": "^1.9.1",
|
|
59
59
|
"@standard-config/tsconfig": "^2.0.2",
|
|
60
60
|
"@types/node": "^22.19.11",
|
|
@@ -62,8 +62,8 @@
|
|
|
62
62
|
"eslint": "^9.39.2",
|
|
63
63
|
"husky": "^9.1.7",
|
|
64
64
|
"jiti": "^2.6.1",
|
|
65
|
-
"oxlint": "^1.
|
|
66
|
-
"oxlint-tsgolint": "^0.14.
|
|
65
|
+
"oxlint": "^1.49.0",
|
|
66
|
+
"oxlint-tsgolint": "^0.14.1",
|
|
67
67
|
"prettier": "^3.8.1",
|
|
68
68
|
"publint": "^0.3.17",
|
|
69
69
|
"react": "^19.2.4",
|