@apst/oxlint 0.0.0-dev.20260324.019d1d21 → 0.0.0-dev.20260522.d3790b2c
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/@types/preset.d.ts +1 -1
- package/dist/constants/default.d.ts +1 -1
- package/dist/constants/default.js.map +1 -1
- package/dist/constants/default.mjs.map +1 -1
- package/dist/constants/ignore-patterns.d.ts +1 -1
- package/dist/constants/ignore-patterns.js +1 -0
- package/dist/constants/ignore-patterns.js.map +1 -1
- package/dist/constants/ignore-patterns.mjs +1 -0
- package/dist/constants/ignore-patterns.mjs.map +1 -1
- package/dist/functions/define.js.map +1 -1
- package/dist/functions/define.mjs.map +1 -1
- package/dist/functions/merge.js.map +1 -1
- package/dist/functions/merge.mjs.map +1 -1
- package/dist/presets/common/plugin/index.js.map +1 -1
- package/dist/presets/common/plugin/index.mjs.map +1 -1
- package/dist/presets/common/preset/index.js.map +1 -1
- package/dist/presets/common/preset/index.mjs.map +1 -1
- package/dist/presets/common/rules/eslint.d.ts +10 -28
- package/dist/presets/common/rules/eslint.js +5 -12
- package/dist/presets/common/rules/eslint.js.map +1 -1
- package/dist/presets/common/rules/eslint.mjs +5 -12
- package/dist/presets/common/rules/eslint.mjs.map +1 -1
- package/dist/presets/common/rules/import.d.ts +8 -4
- package/dist/presets/common/rules/import.js +4 -2
- package/dist/presets/common/rules/import.js.map +1 -1
- package/dist/presets/common/rules/import.mjs +4 -2
- package/dist/presets/common/rules/import.mjs.map +1 -1
- package/dist/presets/common/rules/oxc.js.map +1 -1
- package/dist/presets/common/rules/oxc.mjs.map +1 -1
- package/dist/presets/common/rules/promise.js.map +1 -1
- package/dist/presets/common/rules/promise.mjs.map +1 -1
- package/dist/presets/common/rules/typescript.js.map +1 -1
- package/dist/presets/common/rules/typescript.mjs.map +1 -1
- package/dist/presets/common/rules/unicorn.d.ts +0 -6
- package/dist/presets/common/rules/unicorn.js +0 -1
- package/dist/presets/common/rules/unicorn.js.map +1 -1
- package/dist/presets/common/rules/unicorn.mjs +0 -1
- package/dist/presets/common/rules/unicorn.mjs.map +1 -1
- package/dist/presets/jsx/plugin/index.js.map +1 -1
- package/dist/presets/jsx/plugin/index.mjs.map +1 -1
- package/dist/presets/jsx/preset/index.js.map +1 -1
- package/dist/presets/jsx/preset/index.mjs.map +1 -1
- package/dist/presets/jsx/rules/jsx-a11y.js.map +1 -1
- package/dist/presets/jsx/rules/jsx-a11y.mjs.map +1 -1
- package/dist/presets/next/plugin/index.js.map +1 -1
- package/dist/presets/next/plugin/index.mjs.map +1 -1
- package/dist/presets/next/preset/index.js.map +1 -1
- package/dist/presets/next/preset/index.mjs.map +1 -1
- package/dist/presets/next/rules/nextjs.js.map +1 -1
- package/dist/presets/next/rules/nextjs.mjs.map +1 -1
- package/dist/presets/node/plugin/index.js.map +1 -1
- package/dist/presets/node/plugin/index.mjs.map +1 -1
- package/dist/presets/node/preset/index.js.map +1 -1
- package/dist/presets/node/preset/index.mjs.map +1 -1
- package/dist/presets/node/rules/node.js.map +1 -1
- package/dist/presets/node/rules/node.mjs.map +1 -1
- package/dist/presets/react/plugin/index.js.map +1 -1
- package/dist/presets/react/plugin/index.mjs.map +1 -1
- package/dist/presets/react/preset/index.js.map +1 -1
- package/dist/presets/react/preset/index.mjs.map +1 -1
- package/dist/presets/react/rules/react.js.map +1 -1
- package/dist/presets/react/rules/react.mjs.map +1 -1
- package/dist/presets/vitest/plugin/index.js.map +1 -1
- package/dist/presets/vitest/plugin/index.mjs.map +1 -1
- package/dist/presets/vitest/preset/index.js.map +1 -1
- package/dist/presets/vitest/preset/index.mjs.map +1 -1
- package/dist/presets/vitest/rules/vitest.js.map +1 -1
- package/dist/presets/vitest/rules/vitest.mjs.map +1 -1
- package/package.json +18 -18
package/dist/@types/preset.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Default config for Oxlint.
|
|
3
3
|
*/
|
|
4
4
|
declare const CONFIG_DEFAULT: {
|
|
5
|
-
readonly ignorePatterns: ["**/.git/**", "**/__MACOSX/**", "**/.DS_Store", "**/node_modules/**", "**/.panda/**", "**/.next/**", "**/.expo/**", "**/.vercel/**", "**/dist/**", "build/**", "app/build/**", "web/build/**", "out/**", "app/out/**", "web/out/**", "**/package-lock.json", "**/yarn.lock", "**/pnpm-lock.yaml", "**/bun.lock"];
|
|
5
|
+
readonly ignorePatterns: ["**/.git/**", "**/__MACOSX/**", "**/.DS_Store", ".agents/skills/**", "**/node_modules/**", "**/.panda/**", "**/.next/**", "**/.expo/**", "**/.vercel/**", "**/dist/**", "build/**", "app/build/**", "web/build/**", "out/**", "app/out/**", "web/out/**", "**/package-lock.json", "**/yarn.lock", "**/pnpm-lock.yaml", "**/bun.lock"];
|
|
6
6
|
};
|
|
7
7
|
export { CONFIG_DEFAULT };
|
|
8
8
|
//# sourceMappingURL=default.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default.js","names":["IGNORE_PATTERNS_DEFAULT"],"sources":["../../src/constants/default.ts"],"sourcesContent":["import type { OxlintConfig } from \"oxlint\";\n\nimport { IGNORE_PATTERNS_DEFAULT } from \"#/constants/ignore-patterns\";\n\n/**\n * Default config for Oxlint.\n */\nconst CONFIG_DEFAULT = {\n ignorePatterns: IGNORE_PATTERNS_DEFAULT,\n} as const satisfies OxlintConfig;\n\nexport { CONFIG_DEFAULT };\n"],"mappings":";;;;;;AAOA,MAAM,iBAAiB,EACnB,gBAAgBA,
|
|
1
|
+
{"version":3,"file":"default.js","names":["IGNORE_PATTERNS_DEFAULT"],"sources":["../../src/constants/default.ts"],"sourcesContent":["import type { OxlintConfig } from \"oxlint\";\n\nimport { IGNORE_PATTERNS_DEFAULT } from \"#/constants/ignore-patterns\";\n\n/**\n * Default config for Oxlint.\n */\nconst CONFIG_DEFAULT = {\n ignorePatterns: IGNORE_PATTERNS_DEFAULT,\n} as const satisfies OxlintConfig;\n\nexport { CONFIG_DEFAULT };\n"],"mappings":";;;;;;AAOA,MAAM,iBAAiB,EACnB,gBAAgBA,0DACpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default.mjs","names":[],"sources":["../../src/constants/default.ts"],"sourcesContent":["import type { OxlintConfig } from \"oxlint\";\n\nimport { IGNORE_PATTERNS_DEFAULT } from \"#/constants/ignore-patterns\";\n\n/**\n * Default config for Oxlint.\n */\nconst CONFIG_DEFAULT = {\n ignorePatterns: IGNORE_PATTERNS_DEFAULT,\n} as const satisfies OxlintConfig;\n\nexport { CONFIG_DEFAULT };\n"],"mappings":";;;;;AAOA,MAAM,iBAAiB,EACnB,gBAAgB,
|
|
1
|
+
{"version":3,"file":"default.mjs","names":[],"sources":["../../src/constants/default.ts"],"sourcesContent":["import type { OxlintConfig } from \"oxlint\";\n\nimport { IGNORE_PATTERNS_DEFAULT } from \"#/constants/ignore-patterns\";\n\n/**\n * Default config for Oxlint.\n */\nconst CONFIG_DEFAULT = {\n ignorePatterns: IGNORE_PATTERNS_DEFAULT,\n} as const satisfies OxlintConfig;\n\nexport { CONFIG_DEFAULT };\n"],"mappings":";;;;;AAOA,MAAM,iBAAiB,EACnB,gBAAgB,wBACpB"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const IGNORE_PATTERNS_DEFAULT: ["**/.git/**", "**/__MACOSX/**", "**/.DS_Store", "**/node_modules/**", "**/.panda/**", "**/.next/**", "**/.expo/**", "**/.vercel/**", "**/dist/**", "build/**", "app/build/**", "web/build/**", "out/**", "app/out/**", "web/out/**", "**/package-lock.json", "**/yarn.lock", "**/pnpm-lock.yaml", "**/bun.lock"];
|
|
1
|
+
declare const IGNORE_PATTERNS_DEFAULT: ["**/.git/**", "**/__MACOSX/**", "**/.DS_Store", ".agents/skills/**", "**/node_modules/**", "**/.panda/**", "**/.next/**", "**/.expo/**", "**/.vercel/**", "**/dist/**", "build/**", "app/build/**", "web/build/**", "out/**", "app/out/**", "web/out/**", "**/package-lock.json", "**/yarn.lock", "**/pnpm-lock.yaml", "**/bun.lock"];
|
|
2
2
|
export { IGNORE_PATTERNS_DEFAULT };
|
|
3
3
|
//# sourceMappingURL=ignore-patterns.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ignore-patterns.js","names":[],"sources":["../../src/constants/ignore-patterns.ts"],"sourcesContent":["const IGNORE_PATTERNS_DEFAULT = [\n // git\n \"**/.git/**\",\n // macOS\n \"**/__MACOSX/**\",\n \"**/.DS_Store\",\n // node modules\n \"**/node_modules/**\",\n // build\n \"**/.panda/**\",\n \"**/.next/**\",\n \"**/.expo/**\",\n \"**/.vercel/**\",\n \"**/dist/**\",\n \"build/**\",\n \"app/build/**\",\n \"web/build/**\",\n \"out/**\",\n \"app/out/**\",\n \"web/out/**\",\n // lock\n \"**/package-lock.json\",\n \"**/yarn.lock\",\n \"**/pnpm-lock.yaml\",\n \"**/bun.lock\",\n] as const satisfies string[];\n\nexport { IGNORE_PATTERNS_DEFAULT };\n"],"mappings":";;AAAA,MAAM,0BAA0B;CAE5B;CAEA;CACA;CAEA;CAEA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CACA;CACA;
|
|
1
|
+
{"version":3,"file":"ignore-patterns.js","names":[],"sources":["../../src/constants/ignore-patterns.ts"],"sourcesContent":["const IGNORE_PATTERNS_DEFAULT = [\n // git\n \"**/.git/**\",\n // macOS\n \"**/__MACOSX/**\",\n \"**/.DS_Store\",\n // agents\n \".agents/skills/**\",\n // node modules\n \"**/node_modules/**\",\n // build\n \"**/.panda/**\",\n \"**/.next/**\",\n \"**/.expo/**\",\n \"**/.vercel/**\",\n \"**/dist/**\",\n \"build/**\",\n \"app/build/**\",\n \"web/build/**\",\n \"out/**\",\n \"app/out/**\",\n \"web/out/**\",\n // lock\n \"**/package-lock.json\",\n \"**/yarn.lock\",\n \"**/pnpm-lock.yaml\",\n \"**/bun.lock\",\n] as const satisfies string[];\n\nexport { IGNORE_PATTERNS_DEFAULT };\n"],"mappings":";;AAAA,MAAM,0BAA0B;CAE5B;CAEA;CACA;CAEA;CAEA;CAEA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CACA;CACA;AACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ignore-patterns.mjs","names":[],"sources":["../../src/constants/ignore-patterns.ts"],"sourcesContent":["const IGNORE_PATTERNS_DEFAULT = [\n // git\n \"**/.git/**\",\n // macOS\n \"**/__MACOSX/**\",\n \"**/.DS_Store\",\n // node modules\n \"**/node_modules/**\",\n // build\n \"**/.panda/**\",\n \"**/.next/**\",\n \"**/.expo/**\",\n \"**/.vercel/**\",\n \"**/dist/**\",\n \"build/**\",\n \"app/build/**\",\n \"web/build/**\",\n \"out/**\",\n \"app/out/**\",\n \"web/out/**\",\n // lock\n \"**/package-lock.json\",\n \"**/yarn.lock\",\n \"**/pnpm-lock.yaml\",\n \"**/bun.lock\",\n] as const satisfies string[];\n\nexport { IGNORE_PATTERNS_DEFAULT };\n"],"mappings":"AAAA,MAAM,0BAA0B;CAE5B;CAEA;CACA;CAEA;CAEA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CACA;CACA;
|
|
1
|
+
{"version":3,"file":"ignore-patterns.mjs","names":[],"sources":["../../src/constants/ignore-patterns.ts"],"sourcesContent":["const IGNORE_PATTERNS_DEFAULT = [\n // git\n \"**/.git/**\",\n // macOS\n \"**/__MACOSX/**\",\n \"**/.DS_Store\",\n // agents\n \".agents/skills/**\",\n // node modules\n \"**/node_modules/**\",\n // build\n \"**/.panda/**\",\n \"**/.next/**\",\n \"**/.expo/**\",\n \"**/.vercel/**\",\n \"**/dist/**\",\n \"build/**\",\n \"app/build/**\",\n \"web/build/**\",\n \"out/**\",\n \"app/out/**\",\n \"web/out/**\",\n // lock\n \"**/package-lock.json\",\n \"**/yarn.lock\",\n \"**/pnpm-lock.yaml\",\n \"**/bun.lock\",\n] as const satisfies string[];\n\nexport { IGNORE_PATTERNS_DEFAULT };\n"],"mappings":"AAAA,MAAM,0BAA0B;CAE5B;CAEA;CACA;CAEA;CAEA;CAEA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CACA;CACA;AACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"define.js","names":["mergeConfig","CONFIG_DEFAULT"],"sources":["../../src/functions/define.ts"],"sourcesContent":["import type { OxlintConfig } from \"oxlint\";\n\nimport type { Preset, PresetResult } from \"#/@types/preset\";\n\nimport { clone, toMerged } from \"es-toolkit\";\n\nimport { CONFIG_DEFAULT } from \"#/constants/default\";\nimport { mergeConfig } from \"#/functions/merge\";\n\nconst defineConfigFn = (\n userConfig?: OxlintConfig,\n presets?: Preset[],\n): OxlintConfig => {\n let config: OxlintConfig = mergeConfig(clone(CONFIG_DEFAULT), userConfig);\n\n if (!presets) return config;\n\n for (const preset of presets) {\n const presetResult: PresetResult = preset({\n config,\n });\n\n config = toMerged(config, presetResult.config);\n }\n\n return config;\n};\n\n/**\n * Define Oxlint configuration.\n *\n * ### Example\n *\n * ```ts\n * import { defineConfig } from \"@apst/oxlint\";\n * import { commonPreset } from \"@apst/oxlint/presets/common\";\n * import { reactPreset } from \"@apst/oxlint/presets/react\";\n *\n * export default defineConfig([\n * commonPreset(),\n * reactPreset(),\n * ]);\n * ```\n */\nfunction defineConfig(presets?: Preset[]): OxlintConfig;\n\n/**\n * Define Oxlint configuration.\n *\n * All arrays will not be merged, adding new values will replace existing values.\n *\n * ### Example\n *\n * ```ts\n * import { defineConfig } from \"@apst/oxlint\";\n * import { IGNORE_PATTERNS_DEFAULT } from \"@apst/oxlint/constants/ignore-patterns\";\n * import { commonPreset } from \"@apst/oxlint/presets/common\";\n * import { reactPreset } from \"@apst/oxlint/presets/react\";\n *\n * export default defineConfig({\n * ignorePatterns: [\n * ...IGNORE_PATTERNS_DEFAULT,\n * // ...\n * ],\n * }, [\n * commonPreset(),\n * reactPreset(),\n * ]);\n * ```\n */\nfunction defineConfig(config?: OxlintConfig, presets?: Preset[]): OxlintConfig;\n\nfunction defineConfig(\n presetsOrConfig?: Preset[] | OxlintConfig,\n optionalPresets?: Preset[],\n): OxlintConfig {\n const config: OxlintConfig | undefined = Array.isArray(presetsOrConfig)\n ? void 0\n : presetsOrConfig;\n\n const presets: Preset[] | undefined = Array.isArray(presetsOrConfig)\n ? presetsOrConfig\n : optionalPresets;\n\n return defineConfigFn(config, presets);\n}\n\nexport { defineConfig };\n"],"mappings":";;;;AASA,MAAM,kBACF,YACA,YACe;CACf,IAAI,SAAuBA,gDAAkBC,
|
|
1
|
+
{"version":3,"file":"define.js","names":["mergeConfig","CONFIG_DEFAULT"],"sources":["../../src/functions/define.ts"],"sourcesContent":["import type { OxlintConfig } from \"oxlint\";\n\nimport type { Preset, PresetResult } from \"#/@types/preset\";\n\nimport { clone, toMerged } from \"es-toolkit\";\n\nimport { CONFIG_DEFAULT } from \"#/constants/default\";\nimport { mergeConfig } from \"#/functions/merge\";\n\nconst defineConfigFn = (\n userConfig?: OxlintConfig,\n presets?: Preset[],\n): OxlintConfig => {\n let config: OxlintConfig = mergeConfig(clone(CONFIG_DEFAULT), userConfig);\n\n if (!presets) return config;\n\n for (const preset of presets) {\n const presetResult: PresetResult = preset({\n config,\n });\n\n config = toMerged(config, presetResult.config);\n }\n\n return config;\n};\n\n/**\n * Define Oxlint configuration.\n *\n * ### Example\n *\n * ```ts\n * import { defineConfig } from \"@apst/oxlint\";\n * import { commonPreset } from \"@apst/oxlint/presets/common\";\n * import { reactPreset } from \"@apst/oxlint/presets/react\";\n *\n * export default defineConfig([\n * commonPreset(),\n * reactPreset(),\n * ]);\n * ```\n */\nfunction defineConfig(presets?: Preset[]): OxlintConfig;\n\n/**\n * Define Oxlint configuration.\n *\n * All arrays will not be merged, adding new values will replace existing values.\n *\n * ### Example\n *\n * ```ts\n * import { defineConfig } from \"@apst/oxlint\";\n * import { IGNORE_PATTERNS_DEFAULT } from \"@apst/oxlint/constants/ignore-patterns\";\n * import { commonPreset } from \"@apst/oxlint/presets/common\";\n * import { reactPreset } from \"@apst/oxlint/presets/react\";\n *\n * export default defineConfig({\n * ignorePatterns: [\n * ...IGNORE_PATTERNS_DEFAULT,\n * // ...\n * ],\n * }, [\n * commonPreset(),\n * reactPreset(),\n * ]);\n * ```\n */\nfunction defineConfig(config?: OxlintConfig, presets?: Preset[]): OxlintConfig;\n\nfunction defineConfig(\n presetsOrConfig?: Preset[] | OxlintConfig,\n optionalPresets?: Preset[],\n): OxlintConfig {\n const config: OxlintConfig | undefined = Array.isArray(presetsOrConfig)\n ? void 0\n : presetsOrConfig;\n\n const presets: Preset[] | undefined = Array.isArray(presetsOrConfig)\n ? presetsOrConfig\n : optionalPresets;\n\n return defineConfigFn(config, presets);\n}\n\nexport { defineConfig };\n"],"mappings":";;;;AASA,MAAM,kBACF,YACA,YACe;CACf,IAAI,SAAuBA,gDAAkBC,wCAAc,GAAG,UAAU;CAExE,IAAI,CAAC,SAAS,OAAO;CAErB,KAAK,MAAM,UAAU,SAAS;EAC1B,MAAM,eAA6B,OAAO,EACtC,OACJ,CAAC;EAED,kCAAkB,QAAQ,aAAa,MAAM;CACjD;CAEA,OAAO;AACX;AA8CA,SAAS,aACL,iBACA,iBACY;CASZ,OAAO,eARkC,MAAM,QAAQ,eAAe,IAChE,KAAK,IACL,iBAEgC,MAAM,QAAQ,eAAe,IAC7D,kBACA,eAE+B;AACzC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"define.mjs","names":[],"sources":["../../src/functions/define.ts"],"sourcesContent":["import type { OxlintConfig } from \"oxlint\";\n\nimport type { Preset, PresetResult } from \"#/@types/preset\";\n\nimport { clone, toMerged } from \"es-toolkit\";\n\nimport { CONFIG_DEFAULT } from \"#/constants/default\";\nimport { mergeConfig } from \"#/functions/merge\";\n\nconst defineConfigFn = (\n userConfig?: OxlintConfig,\n presets?: Preset[],\n): OxlintConfig => {\n let config: OxlintConfig = mergeConfig(clone(CONFIG_DEFAULT), userConfig);\n\n if (!presets) return config;\n\n for (const preset of presets) {\n const presetResult: PresetResult = preset({\n config,\n });\n\n config = toMerged(config, presetResult.config);\n }\n\n return config;\n};\n\n/**\n * Define Oxlint configuration.\n *\n * ### Example\n *\n * ```ts\n * import { defineConfig } from \"@apst/oxlint\";\n * import { commonPreset } from \"@apst/oxlint/presets/common\";\n * import { reactPreset } from \"@apst/oxlint/presets/react\";\n *\n * export default defineConfig([\n * commonPreset(),\n * reactPreset(),\n * ]);\n * ```\n */\nfunction defineConfig(presets?: Preset[]): OxlintConfig;\n\n/**\n * Define Oxlint configuration.\n *\n * All arrays will not be merged, adding new values will replace existing values.\n *\n * ### Example\n *\n * ```ts\n * import { defineConfig } from \"@apst/oxlint\";\n * import { IGNORE_PATTERNS_DEFAULT } from \"@apst/oxlint/constants/ignore-patterns\";\n * import { commonPreset } from \"@apst/oxlint/presets/common\";\n * import { reactPreset } from \"@apst/oxlint/presets/react\";\n *\n * export default defineConfig({\n * ignorePatterns: [\n * ...IGNORE_PATTERNS_DEFAULT,\n * // ...\n * ],\n * }, [\n * commonPreset(),\n * reactPreset(),\n * ]);\n * ```\n */\nfunction defineConfig(config?: OxlintConfig, presets?: Preset[]): OxlintConfig;\n\nfunction defineConfig(\n presetsOrConfig?: Preset[] | OxlintConfig,\n optionalPresets?: Preset[],\n): OxlintConfig {\n const config: OxlintConfig | undefined = Array.isArray(presetsOrConfig)\n ? void 0\n : presetsOrConfig;\n\n const presets: Preset[] | undefined = Array.isArray(presetsOrConfig)\n ? presetsOrConfig\n : optionalPresets;\n\n return defineConfigFn(config, presets);\n}\n\nexport { defineConfig };\n"],"mappings":";;;;AASA,MAAM,kBACF,YACA,YACe;CACf,IAAI,SAAuB,YAAY,MAAM,
|
|
1
|
+
{"version":3,"file":"define.mjs","names":[],"sources":["../../src/functions/define.ts"],"sourcesContent":["import type { OxlintConfig } from \"oxlint\";\n\nimport type { Preset, PresetResult } from \"#/@types/preset\";\n\nimport { clone, toMerged } from \"es-toolkit\";\n\nimport { CONFIG_DEFAULT } from \"#/constants/default\";\nimport { mergeConfig } from \"#/functions/merge\";\n\nconst defineConfigFn = (\n userConfig?: OxlintConfig,\n presets?: Preset[],\n): OxlintConfig => {\n let config: OxlintConfig = mergeConfig(clone(CONFIG_DEFAULT), userConfig);\n\n if (!presets) return config;\n\n for (const preset of presets) {\n const presetResult: PresetResult = preset({\n config,\n });\n\n config = toMerged(config, presetResult.config);\n }\n\n return config;\n};\n\n/**\n * Define Oxlint configuration.\n *\n * ### Example\n *\n * ```ts\n * import { defineConfig } from \"@apst/oxlint\";\n * import { commonPreset } from \"@apst/oxlint/presets/common\";\n * import { reactPreset } from \"@apst/oxlint/presets/react\";\n *\n * export default defineConfig([\n * commonPreset(),\n * reactPreset(),\n * ]);\n * ```\n */\nfunction defineConfig(presets?: Preset[]): OxlintConfig;\n\n/**\n * Define Oxlint configuration.\n *\n * All arrays will not be merged, adding new values will replace existing values.\n *\n * ### Example\n *\n * ```ts\n * import { defineConfig } from \"@apst/oxlint\";\n * import { IGNORE_PATTERNS_DEFAULT } from \"@apst/oxlint/constants/ignore-patterns\";\n * import { commonPreset } from \"@apst/oxlint/presets/common\";\n * import { reactPreset } from \"@apst/oxlint/presets/react\";\n *\n * export default defineConfig({\n * ignorePatterns: [\n * ...IGNORE_PATTERNS_DEFAULT,\n * // ...\n * ],\n * }, [\n * commonPreset(),\n * reactPreset(),\n * ]);\n * ```\n */\nfunction defineConfig(config?: OxlintConfig, presets?: Preset[]): OxlintConfig;\n\nfunction defineConfig(\n presetsOrConfig?: Preset[] | OxlintConfig,\n optionalPresets?: Preset[],\n): OxlintConfig {\n const config: OxlintConfig | undefined = Array.isArray(presetsOrConfig)\n ? void 0\n : presetsOrConfig;\n\n const presets: Preset[] | undefined = Array.isArray(presetsOrConfig)\n ? presetsOrConfig\n : optionalPresets;\n\n return defineConfigFn(config, presets);\n}\n\nexport { defineConfig };\n"],"mappings":";;;;AASA,MAAM,kBACF,YACA,YACe;CACf,IAAI,SAAuB,YAAY,MAAM,cAAc,GAAG,UAAU;CAExE,IAAI,CAAC,SAAS,OAAO;CAErB,KAAK,MAAM,UAAU,SAAS;EAC1B,MAAM,eAA6B,OAAO,EACtC,OACJ,CAAC;EAED,SAAS,SAAS,QAAQ,aAAa,MAAM;CACjD;CAEA,OAAO;AACX;AA8CA,SAAS,aACL,iBACA,iBACY;CASZ,OAAO,eARkC,MAAM,QAAQ,eAAe,IAChE,KAAK,IACL,iBAEgC,MAAM,QAAQ,eAAe,IAC7D,kBACA,eAE+B;AACzC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merge.js","names":[],"sources":["../../src/functions/merge.ts"],"sourcesContent":["import { mergeWith } from \"es-toolkit\";\n\nconst mergeConfig = <\n T extends Record<PropertyKey, any>,\n S extends Record<PropertyKey, any>,\n>(\n target: T,\n source?: S,\n): T & S => {\n if (!source) return target;\n\n return mergeWith(target, source, (_: unknown, target: unknown): unknown => {\n // array replacement\n if (Array.isArray(target)) return target;\n // default deep merge\n return void 0;\n });\n};\n\nexport { mergeConfig };\n"],"mappings":";;AAEA,MAAM,eAIF,QACA,WACQ;
|
|
1
|
+
{"version":3,"file":"merge.js","names":[],"sources":["../../src/functions/merge.ts"],"sourcesContent":["import { mergeWith } from \"es-toolkit\";\n\nconst mergeConfig = <\n T extends Record<PropertyKey, any>,\n S extends Record<PropertyKey, any>,\n>(\n target: T,\n source?: S,\n): T & S => {\n if (!source) return target;\n\n return mergeWith(target, source, (_: unknown, target: unknown): unknown => {\n // array replacement\n if (Array.isArray(target)) return target;\n // default deep merge\n return void 0;\n });\n};\n\nexport { mergeConfig };\n"],"mappings":";;AAEA,MAAM,eAIF,QACA,WACQ;CACR,IAAI,CAAC,QAAQ,OAAO;CAEpB,iCAAiB,QAAQ,SAAS,GAAY,WAA6B;EAEvE,IAAI,MAAM,QAAQ,MAAM,GAAG,OAAO;CAGtC,CAAC;AACL"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merge.mjs","names":[],"sources":["../../src/functions/merge.ts"],"sourcesContent":["import { mergeWith } from \"es-toolkit\";\n\nconst mergeConfig = <\n T extends Record<PropertyKey, any>,\n S extends Record<PropertyKey, any>,\n>(\n target: T,\n source?: S,\n): T & S => {\n if (!source) return target;\n\n return mergeWith(target, source, (_: unknown, target: unknown): unknown => {\n // array replacement\n if (Array.isArray(target)) return target;\n // default deep merge\n return void 0;\n });\n};\n\nexport { mergeConfig };\n"],"mappings":";;AAEA,MAAM,eAIF,QACA,WACQ;
|
|
1
|
+
{"version":3,"file":"merge.mjs","names":[],"sources":["../../src/functions/merge.ts"],"sourcesContent":["import { mergeWith } from \"es-toolkit\";\n\nconst mergeConfig = <\n T extends Record<PropertyKey, any>,\n S extends Record<PropertyKey, any>,\n>(\n target: T,\n source?: S,\n): T & S => {\n if (!source) return target;\n\n return mergeWith(target, source, (_: unknown, target: unknown): unknown => {\n // array replacement\n if (Array.isArray(target)) return target;\n // default deep merge\n return void 0;\n });\n};\n\nexport { mergeConfig };\n"],"mappings":";;AAEA,MAAM,eAIF,QACA,WACQ;CACR,IAAI,CAAC,QAAQ,OAAO;CAEpB,OAAO,UAAU,QAAQ,SAAS,GAAY,WAA6B;EAEvE,IAAI,MAAM,QAAQ,MAAM,GAAG,OAAO;CAGtC,CAAC;AACL"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/presets/common/plugin/index.ts"],"sourcesContent":["import type { LintPlugins } from \"#/@types/oxlint\";\n\nconst PLUGIN_COMMON = [\n \"eslint\",\n \"typescript\",\n \"unicorn\",\n \"oxc\",\n \"import\",\n \"promise\",\n] as const satisfies LintPlugins;\n\nexport { PLUGIN_COMMON };\n"],"mappings":";AAEA,MAAM,gBAAgB;CAClB;CACA;CACA;CACA;CACA;CACA;
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/presets/common/plugin/index.ts"],"sourcesContent":["import type { LintPlugins } from \"#/@types/oxlint\";\n\nconst PLUGIN_COMMON = [\n \"eslint\",\n \"typescript\",\n \"unicorn\",\n \"oxc\",\n \"import\",\n \"promise\",\n] as const satisfies LintPlugins;\n\nexport { PLUGIN_COMMON };\n"],"mappings":";AAEA,MAAM,gBAAgB;CAClB;CACA;CACA;CACA;CACA;CACA;AACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/presets/common/plugin/index.ts"],"sourcesContent":["import type { LintPlugins } from \"#/@types/oxlint\";\n\nconst PLUGIN_COMMON = [\n \"eslint\",\n \"typescript\",\n \"unicorn\",\n \"oxc\",\n \"import\",\n \"promise\",\n] as const satisfies LintPlugins;\n\nexport { PLUGIN_COMMON };\n"],"mappings":"AAEA,MAAM,gBAAgB;CAClB;CACA;CACA;CACA;CACA;CACA;
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/presets/common/plugin/index.ts"],"sourcesContent":["import type { LintPlugins } from \"#/@types/oxlint\";\n\nconst PLUGIN_COMMON = [\n \"eslint\",\n \"typescript\",\n \"unicorn\",\n \"oxc\",\n \"import\",\n \"promise\",\n] as const satisfies LintPlugins;\n\nexport { PLUGIN_COMMON };\n"],"mappings":"AAEA,MAAM,gBAAgB;CAClB;CACA;CACA;CACA;CACA;CACA;AACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["PLUGIN_COMMON","RULES_ESLINT","RULES_TYPESCRIPT","RULES_UNICORN","RULES_OXC","RULES_IMPORT","RULES_PROMISE"],"sources":["../../../../src/presets/common/preset/index.ts"],"sourcesContent":["import type { OxlintConfig } from \"oxlint\";\n\nimport type { Preset, PresetResult } from \"#/@types/preset\";\n\nimport { toMerged } from \"es-toolkit\";\n\nimport { PLUGIN_COMMON } from \"#/presets/common/plugin\";\nimport { RULES_ESLINT } from \"#/presets/common/rules/eslint\";\nimport { RULES_IMPORT } from \"#/presets/common/rules/import\";\nimport { RULES_OXC } from \"#/presets/common/rules/oxc\";\nimport { RULES_PROMISE } from \"#/presets/common/rules/promise\";\nimport { RULES_TYPESCRIPT } from \"#/presets/common/rules/typescript\";\nimport { RULES_UNICORN } from \"#/presets/common/rules/unicorn\";\n\nconst commonPreset = (): Preset => {\n return ({ config: internalConfig }): PresetResult => {\n const config: OxlintConfig = toMerged(internalConfig, {\n plugins: [\n ...PLUGIN_COMMON,\n ],\n rules: {\n ...RULES_ESLINT,\n ...RULES_TYPESCRIPT,\n ...RULES_UNICORN,\n ...RULES_OXC,\n ...RULES_IMPORT,\n ...RULES_PROMISE,\n },\n } satisfies OxlintConfig);\n\n return {\n config,\n };\n };\n};\n\nexport { commonPreset };\n"],"mappings":";;;;;;;;;AAcA,MAAM,qBAA6B;
|
|
1
|
+
{"version":3,"file":"index.js","names":["PLUGIN_COMMON","RULES_ESLINT","RULES_TYPESCRIPT","RULES_UNICORN","RULES_OXC","RULES_IMPORT","RULES_PROMISE"],"sources":["../../../../src/presets/common/preset/index.ts"],"sourcesContent":["import type { OxlintConfig } from \"oxlint\";\n\nimport type { Preset, PresetResult } from \"#/@types/preset\";\n\nimport { toMerged } from \"es-toolkit\";\n\nimport { PLUGIN_COMMON } from \"#/presets/common/plugin\";\nimport { RULES_ESLINT } from \"#/presets/common/rules/eslint\";\nimport { RULES_IMPORT } from \"#/presets/common/rules/import\";\nimport { RULES_OXC } from \"#/presets/common/rules/oxc\";\nimport { RULES_PROMISE } from \"#/presets/common/rules/promise\";\nimport { RULES_TYPESCRIPT } from \"#/presets/common/rules/typescript\";\nimport { RULES_UNICORN } from \"#/presets/common/rules/unicorn\";\n\nconst commonPreset = (): Preset => {\n return ({ config: internalConfig }): PresetResult => {\n const config: OxlintConfig = toMerged(internalConfig, {\n plugins: [\n ...PLUGIN_COMMON,\n ],\n rules: {\n ...RULES_ESLINT,\n ...RULES_TYPESCRIPT,\n ...RULES_UNICORN,\n ...RULES_OXC,\n ...RULES_IMPORT,\n ...RULES_PROMISE,\n },\n } satisfies OxlintConfig);\n\n return {\n config,\n };\n };\n};\n\nexport { commonPreset };\n"],"mappings":";;;;;;;;;AAcA,MAAM,qBAA6B;CAC/B,QAAQ,EAAE,QAAQ,qBAAmC;EAejD,OAAO,EACH,iCAfkC,gBAAgB;GAClD,SAAS,CACL,GAAGA,2BACP;GACA,OAAO;IACH,GAAGC;IACH,GAAGC;IACH,GAAGC;IACH,GAAGC;IACH,GAAGC;IACH,GAAGC;GACP;EACJ,CAGS,EACT;CACJ;AACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/presets/common/preset/index.ts"],"sourcesContent":["import type { OxlintConfig } from \"oxlint\";\n\nimport type { Preset, PresetResult } from \"#/@types/preset\";\n\nimport { toMerged } from \"es-toolkit\";\n\nimport { PLUGIN_COMMON } from \"#/presets/common/plugin\";\nimport { RULES_ESLINT } from \"#/presets/common/rules/eslint\";\nimport { RULES_IMPORT } from \"#/presets/common/rules/import\";\nimport { RULES_OXC } from \"#/presets/common/rules/oxc\";\nimport { RULES_PROMISE } from \"#/presets/common/rules/promise\";\nimport { RULES_TYPESCRIPT } from \"#/presets/common/rules/typescript\";\nimport { RULES_UNICORN } from \"#/presets/common/rules/unicorn\";\n\nconst commonPreset = (): Preset => {\n return ({ config: internalConfig }): PresetResult => {\n const config: OxlintConfig = toMerged(internalConfig, {\n plugins: [\n ...PLUGIN_COMMON,\n ],\n rules: {\n ...RULES_ESLINT,\n ...RULES_TYPESCRIPT,\n ...RULES_UNICORN,\n ...RULES_OXC,\n ...RULES_IMPORT,\n ...RULES_PROMISE,\n },\n } satisfies OxlintConfig);\n\n return {\n config,\n };\n };\n};\n\nexport { commonPreset };\n"],"mappings":";;;;;;;;;AAcA,MAAM,qBAA6B;
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/presets/common/preset/index.ts"],"sourcesContent":["import type { OxlintConfig } from \"oxlint\";\n\nimport type { Preset, PresetResult } from \"#/@types/preset\";\n\nimport { toMerged } from \"es-toolkit\";\n\nimport { PLUGIN_COMMON } from \"#/presets/common/plugin\";\nimport { RULES_ESLINT } from \"#/presets/common/rules/eslint\";\nimport { RULES_IMPORT } from \"#/presets/common/rules/import\";\nimport { RULES_OXC } from \"#/presets/common/rules/oxc\";\nimport { RULES_PROMISE } from \"#/presets/common/rules/promise\";\nimport { RULES_TYPESCRIPT } from \"#/presets/common/rules/typescript\";\nimport { RULES_UNICORN } from \"#/presets/common/rules/unicorn\";\n\nconst commonPreset = (): Preset => {\n return ({ config: internalConfig }): PresetResult => {\n const config: OxlintConfig = toMerged(internalConfig, {\n plugins: [\n ...PLUGIN_COMMON,\n ],\n rules: {\n ...RULES_ESLINT,\n ...RULES_TYPESCRIPT,\n ...RULES_UNICORN,\n ...RULES_OXC,\n ...RULES_IMPORT,\n ...RULES_PROMISE,\n },\n } satisfies OxlintConfig);\n\n return {\n config,\n };\n };\n};\n\nexport { commonPreset };\n"],"mappings":";;;;;;;;;AAcA,MAAM,qBAA6B;CAC/B,QAAQ,EAAE,QAAQ,qBAAmC;EAejD,OAAO,EACH,QAfyB,SAAS,gBAAgB;GAClD,SAAS,CACL,GAAG,aACP;GACA,OAAO;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;GACP;EACJ,CAGS,EACT;CACJ;AACJ"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
declare const RULES_ESLINT_NURSERY: {
|
|
2
2
|
readonly "getter-return": "error";
|
|
3
|
-
readonly "no-undef": ["error", {
|
|
4
|
-
readonly typeof: true;
|
|
5
|
-
}];
|
|
6
3
|
readonly "no-unreachable": "error";
|
|
7
4
|
};
|
|
8
5
|
declare const RULES_ESLINT_PEDANTIC: {
|
|
@@ -33,25 +30,19 @@ declare const RULES_ESLINT_PERF: {
|
|
|
33
30
|
};
|
|
34
31
|
declare const RULES_ESLINT_RESTRICTION: {
|
|
35
32
|
readonly "no-div-regex": "error";
|
|
36
|
-
readonly "no-param-reassign": ["error", {
|
|
37
|
-
readonly props: true;
|
|
38
|
-
}];
|
|
39
33
|
readonly "no-undefined": "error";
|
|
40
34
|
readonly "no-use-before-define": ["error", {
|
|
41
|
-
readonly allowNamedExports:
|
|
35
|
+
readonly allowNamedExports: true;
|
|
42
36
|
readonly classes: true;
|
|
43
37
|
readonly enums: true;
|
|
44
|
-
readonly functions:
|
|
38
|
+
readonly functions: false;
|
|
45
39
|
readonly ignoreTypeReferences: true;
|
|
46
40
|
readonly typedefs: true;
|
|
47
|
-
readonly variables:
|
|
41
|
+
readonly variables: false;
|
|
48
42
|
}];
|
|
49
43
|
readonly "no-var": "error";
|
|
50
44
|
};
|
|
51
45
|
declare const RULES_ESLINT_STYLE: {
|
|
52
|
-
readonly "arrow-body-style": ["error", "as-needed", {
|
|
53
|
-
readonly requireReturnForObjectLiteral: false;
|
|
54
|
-
}];
|
|
55
46
|
readonly "default-case-last": "error";
|
|
56
47
|
readonly "grouped-accessor-pairs": ["error", "getBeforeSet", {
|
|
57
48
|
readonly enforceForTSTypes: true;
|
|
@@ -80,8 +71,8 @@ declare const RULES_ESLINT_SUSPICIOUS: {
|
|
|
80
71
|
readonly "block-scoped-var": "error";
|
|
81
72
|
readonly "no-extend-native": "error";
|
|
82
73
|
readonly "no-shadow": ["error", {
|
|
83
|
-
readonly builtinGlobals:
|
|
84
|
-
readonly
|
|
74
|
+
readonly builtinGlobals: false;
|
|
75
|
+
readonly hoist: "all";
|
|
85
76
|
readonly ignoreFunctionTypeParameterNameValueShadow: false;
|
|
86
77
|
readonly ignoreOnInitialization: false;
|
|
87
78
|
readonly ignoreTypeValueShadow: false;
|
|
@@ -93,17 +84,14 @@ declare const RULES_ESLINT: {
|
|
|
93
84
|
readonly "block-scoped-var": "error";
|
|
94
85
|
readonly "no-extend-native": "error";
|
|
95
86
|
readonly "no-shadow": ["error", {
|
|
96
|
-
readonly builtinGlobals:
|
|
97
|
-
readonly
|
|
87
|
+
readonly builtinGlobals: false;
|
|
88
|
+
readonly hoist: "all";
|
|
98
89
|
readonly ignoreFunctionTypeParameterNameValueShadow: false;
|
|
99
90
|
readonly ignoreOnInitialization: false;
|
|
100
91
|
readonly ignoreTypeValueShadow: false;
|
|
101
92
|
}];
|
|
102
93
|
readonly "no-unexpected-multiline": "error";
|
|
103
94
|
readonly "no-unneeded-ternary": "error";
|
|
104
|
-
readonly "arrow-body-style": ["error", "as-needed", {
|
|
105
|
-
readonly requireReturnForObjectLiteral: false;
|
|
106
|
-
}];
|
|
107
95
|
readonly "default-case-last": "error";
|
|
108
96
|
readonly "grouped-accessor-pairs": ["error", "getBeforeSet", {
|
|
109
97
|
readonly enforceForTSTypes: true;
|
|
@@ -128,18 +116,15 @@ declare const RULES_ESLINT: {
|
|
|
128
116
|
readonly "prefer-rest-params": "error";
|
|
129
117
|
readonly "prefer-spread": "error";
|
|
130
118
|
readonly "no-div-regex": "error";
|
|
131
|
-
readonly "no-param-reassign": ["error", {
|
|
132
|
-
readonly props: true;
|
|
133
|
-
}];
|
|
134
119
|
readonly "no-undefined": "error";
|
|
135
120
|
readonly "no-use-before-define": ["error", {
|
|
136
|
-
readonly allowNamedExports:
|
|
121
|
+
readonly allowNamedExports: true;
|
|
137
122
|
readonly classes: true;
|
|
138
123
|
readonly enums: true;
|
|
139
|
-
readonly functions:
|
|
124
|
+
readonly functions: false;
|
|
140
125
|
readonly ignoreTypeReferences: true;
|
|
141
126
|
readonly typedefs: true;
|
|
142
|
-
readonly variables:
|
|
127
|
+
readonly variables: false;
|
|
143
128
|
}];
|
|
144
129
|
readonly "no-var": "error";
|
|
145
130
|
readonly "no-useless-call": "error";
|
|
@@ -165,9 +150,6 @@ declare const RULES_ESLINT: {
|
|
|
165
150
|
readonly "no-useless-return": "error";
|
|
166
151
|
readonly radix: "error";
|
|
167
152
|
readonly "getter-return": "error";
|
|
168
|
-
readonly "no-undef": ["error", {
|
|
169
|
-
readonly typeof: true;
|
|
170
|
-
}];
|
|
171
153
|
readonly "no-unreachable": "error";
|
|
172
154
|
};
|
|
173
155
|
export { RULES_ESLINT, RULES_ESLINT_NURSERY, RULES_ESLINT_PEDANTIC, RULES_ESLINT_PERF, RULES_ESLINT_RESTRICTION, RULES_ESLINT_STYLE, RULES_ESLINT_SUSPICIOUS };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
const RULES_ESLINT_NURSERY = {
|
|
3
3
|
"getter-return": "error",
|
|
4
|
-
"no-undef": ["error", { typeof: true }],
|
|
5
4
|
"no-unreachable": "error"
|
|
6
5
|
};
|
|
7
6
|
const RULES_ESLINT_PEDANTIC = {
|
|
@@ -22,25 +21,19 @@ const RULES_ESLINT_PEDANTIC = {
|
|
|
22
21
|
const RULES_ESLINT_PERF = { "no-useless-call": "error" };
|
|
23
22
|
const RULES_ESLINT_RESTRICTION = {
|
|
24
23
|
"no-div-regex": "error",
|
|
25
|
-
"no-param-reassign": ["error", { props: true }],
|
|
26
24
|
"no-undefined": "error",
|
|
27
25
|
"no-use-before-define": ["error", {
|
|
28
|
-
allowNamedExports:
|
|
26
|
+
allowNamedExports: true,
|
|
29
27
|
classes: true,
|
|
30
28
|
enums: true,
|
|
31
|
-
functions:
|
|
29
|
+
functions: false,
|
|
32
30
|
ignoreTypeReferences: true,
|
|
33
31
|
typedefs: true,
|
|
34
|
-
variables:
|
|
32
|
+
variables: false
|
|
35
33
|
}],
|
|
36
34
|
"no-var": "error"
|
|
37
35
|
};
|
|
38
36
|
const RULES_ESLINT_STYLE = {
|
|
39
|
-
"arrow-body-style": [
|
|
40
|
-
"error",
|
|
41
|
-
"as-needed",
|
|
42
|
-
{ requireReturnForObjectLiteral: false }
|
|
43
|
-
],
|
|
44
37
|
"default-case-last": "error",
|
|
45
38
|
"grouped-accessor-pairs": [
|
|
46
39
|
"error",
|
|
@@ -65,8 +58,8 @@ const RULES_ESLINT_SUSPICIOUS = {
|
|
|
65
58
|
"block-scoped-var": "error",
|
|
66
59
|
"no-extend-native": "error",
|
|
67
60
|
"no-shadow": ["error", {
|
|
68
|
-
builtinGlobals:
|
|
69
|
-
|
|
61
|
+
builtinGlobals: false,
|
|
62
|
+
hoist: "all",
|
|
70
63
|
ignoreFunctionTypeParameterNameValueShadow: false,
|
|
71
64
|
ignoreOnInitialization: false,
|
|
72
65
|
ignoreTypeValueShadow: false
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eslint.js","names":[],"sources":["../../../../src/presets/common/rules/eslint.ts"],"sourcesContent":["import type { LintRules } from \"#/@types/oxlint\";\n\nconst RULES_ESLINT_NURSERY = {\n \"getter-return\": \"error\",\n \"no-
|
|
1
|
+
{"version":3,"file":"eslint.js","names":[],"sources":["../../../../src/presets/common/rules/eslint.ts"],"sourcesContent":["import type { LintRules } from \"#/@types/oxlint\";\n\nconst RULES_ESLINT_NURSERY = {\n \"getter-return\": \"error\",\n \"no-unreachable\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_ESLINT_PEDANTIC = {\n eqeqeq: [\n \"error\",\n \"always\",\n ],\n \"no-array-constructor\": \"error\",\n \"no-case-declarations\": \"error\",\n \"no-constructor-return\": \"error\",\n \"no-else-return\": [\n \"error\",\n {\n allowElseIf: false,\n },\n ],\n \"no-fallthrough\": [\n \"error\",\n {\n allowEmptyCase: true,\n },\n ],\n \"no-loop-func\": \"error\",\n \"no-new-wrappers\": \"error\",\n \"no-object-constructor\": \"error\",\n \"no-promise-executor-return\": [\n \"error\",\n {\n allowVoid: false,\n },\n ],\n \"no-redeclare\": [\n \"error\",\n {\n builtinGlobals: true,\n },\n ],\n \"no-useless-return\": \"error\",\n radix: \"error\",\n} as const satisfies LintRules;\n\nconst RULES_ESLINT_PERF = {\n \"no-useless-call\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_ESLINT_RESTRICTION = {\n \"no-div-regex\": \"error\",\n \"no-undefined\": \"error\",\n \"no-use-before-define\": [\n \"error\",\n {\n allowNamedExports: true,\n classes: true,\n enums: true,\n functions: false,\n ignoreTypeReferences: true,\n typedefs: true,\n variables: false,\n },\n ],\n \"no-var\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_ESLINT_STYLE = {\n \"default-case-last\": \"error\",\n \"grouped-accessor-pairs\": [\n \"error\",\n \"getBeforeSet\",\n {\n enforceForTSTypes: true,\n },\n ],\n \"no-extra-label\": \"error\",\n \"no-implicit-coercion\": \"error\",\n \"no-label-var\": \"error\",\n \"no-multi-assign\": [\n \"error\",\n {\n ignoreNonDeclaration: false,\n },\n ],\n \"no-template-curly-in-string\": \"error\",\n \"no-useless-computed-key\": [\n \"error\",\n {\n enforceForClassMembers: true,\n },\n ],\n \"prefer-const\": [\n \"error\",\n {\n destructuring: \"all\",\n // avoid conflicts with `no-use-before-define`\n ignoreReadBeforeAssign: true,\n },\n ],\n \"prefer-promise-reject-errors\": [\n \"error\",\n {\n allowEmptyReject: false,\n },\n ],\n \"prefer-rest-params\": \"error\",\n \"prefer-spread\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_ESLINT_SUSPICIOUS = {\n \"block-scoped-var\": \"error\",\n \"no-extend-native\": \"error\",\n \"no-shadow\": [\n \"error\",\n {\n builtinGlobals: false,\n hoist: \"all\",\n ignoreFunctionTypeParameterNameValueShadow: false,\n ignoreOnInitialization: false,\n ignoreTypeValueShadow: false,\n },\n ],\n \"no-unexpected-multiline\": \"error\",\n \"no-unneeded-ternary\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_ESLINT = {\n ...RULES_ESLINT_NURSERY,\n ...RULES_ESLINT_PEDANTIC,\n ...RULES_ESLINT_PERF,\n ...RULES_ESLINT_RESTRICTION,\n ...RULES_ESLINT_STYLE,\n ...RULES_ESLINT_SUSPICIOUS,\n} as const satisfies LintRules;\n\nexport {\n RULES_ESLINT,\n RULES_ESLINT_NURSERY,\n RULES_ESLINT_PEDANTIC,\n RULES_ESLINT_PERF,\n RULES_ESLINT_RESTRICTION,\n RULES_ESLINT_STYLE,\n RULES_ESLINT_SUSPICIOUS,\n};\n"],"mappings":";AAEA,MAAM,uBAAuB;CACzB,iBAAiB;CACjB,kBAAkB;AACtB;AAEA,MAAM,wBAAwB;CAC1B,QAAQ,CACJ,SACA,QACJ;CACA,wBAAwB;CACxB,wBAAwB;CACxB,yBAAyB;CACzB,kBAAkB,CACd,SACA,EACI,aAAa,MACjB,CACJ;CACA,kBAAkB,CACd,SACA,EACI,gBAAgB,KACpB,CACJ;CACA,gBAAgB;CAChB,mBAAmB;CACnB,yBAAyB;CACzB,8BAA8B,CAC1B,SACA,EACI,WAAW,MACf,CACJ;CACA,gBAAgB,CACZ,SACA,EACI,gBAAgB,KACpB,CACJ;CACA,qBAAqB;CACrB,OAAO;AACX;AAEA,MAAM,oBAAoB,EACtB,mBAAmB,QACvB;AAEA,MAAM,2BAA2B;CAC7B,gBAAgB;CAChB,gBAAgB;CAChB,wBAAwB,CACpB,SACA;EACI,mBAAmB;EACnB,SAAS;EACT,OAAO;EACP,WAAW;EACX,sBAAsB;EACtB,UAAU;EACV,WAAW;CACf,CACJ;CACA,UAAU;AACd;AAEA,MAAM,qBAAqB;CACvB,qBAAqB;CACrB,0BAA0B;EACtB;EACA;EACA,EACI,mBAAmB,KACvB;CACJ;CACA,kBAAkB;CAClB,wBAAwB;CACxB,gBAAgB;CAChB,mBAAmB,CACf,SACA,EACI,sBAAsB,MAC1B,CACJ;CACA,+BAA+B;CAC/B,2BAA2B,CACvB,SACA,EACI,wBAAwB,KAC5B,CACJ;CACA,gBAAgB,CACZ,SACA;EACI,eAAe;EAEf,wBAAwB;CAC5B,CACJ;CACA,gCAAgC,CAC5B,SACA,EACI,kBAAkB,MACtB,CACJ;CACA,sBAAsB;CACtB,iBAAiB;AACrB;AAEA,MAAM,0BAA0B;CAC5B,oBAAoB;CACpB,oBAAoB;CACpB,aAAa,CACT,SACA;EACI,gBAAgB;EAChB,OAAO;EACP,4CAA4C;EAC5C,wBAAwB;EACxB,uBAAuB;CAC3B,CACJ;CACA,2BAA2B;CAC3B,uBAAuB;AAC3B;AAEA,MAAM,eAAe;CACjB,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;AACP"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
const RULES_ESLINT_NURSERY = {
|
|
2
2
|
"getter-return": "error",
|
|
3
|
-
"no-undef": ["error", { typeof: true }],
|
|
4
3
|
"no-unreachable": "error"
|
|
5
4
|
};
|
|
6
5
|
const RULES_ESLINT_PEDANTIC = {
|
|
@@ -21,25 +20,19 @@ const RULES_ESLINT_PEDANTIC = {
|
|
|
21
20
|
const RULES_ESLINT_PERF = { "no-useless-call": "error" };
|
|
22
21
|
const RULES_ESLINT_RESTRICTION = {
|
|
23
22
|
"no-div-regex": "error",
|
|
24
|
-
"no-param-reassign": ["error", { props: true }],
|
|
25
23
|
"no-undefined": "error",
|
|
26
24
|
"no-use-before-define": ["error", {
|
|
27
|
-
allowNamedExports:
|
|
25
|
+
allowNamedExports: true,
|
|
28
26
|
classes: true,
|
|
29
27
|
enums: true,
|
|
30
|
-
functions:
|
|
28
|
+
functions: false,
|
|
31
29
|
ignoreTypeReferences: true,
|
|
32
30
|
typedefs: true,
|
|
33
|
-
variables:
|
|
31
|
+
variables: false
|
|
34
32
|
}],
|
|
35
33
|
"no-var": "error"
|
|
36
34
|
};
|
|
37
35
|
const RULES_ESLINT_STYLE = {
|
|
38
|
-
"arrow-body-style": [
|
|
39
|
-
"error",
|
|
40
|
-
"as-needed",
|
|
41
|
-
{ requireReturnForObjectLiteral: false }
|
|
42
|
-
],
|
|
43
36
|
"default-case-last": "error",
|
|
44
37
|
"grouped-accessor-pairs": [
|
|
45
38
|
"error",
|
|
@@ -64,8 +57,8 @@ const RULES_ESLINT_SUSPICIOUS = {
|
|
|
64
57
|
"block-scoped-var": "error",
|
|
65
58
|
"no-extend-native": "error",
|
|
66
59
|
"no-shadow": ["error", {
|
|
67
|
-
builtinGlobals:
|
|
68
|
-
|
|
60
|
+
builtinGlobals: false,
|
|
61
|
+
hoist: "all",
|
|
69
62
|
ignoreFunctionTypeParameterNameValueShadow: false,
|
|
70
63
|
ignoreOnInitialization: false,
|
|
71
64
|
ignoreTypeValueShadow: false
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eslint.mjs","names":[],"sources":["../../../../src/presets/common/rules/eslint.ts"],"sourcesContent":["import type { LintRules } from \"#/@types/oxlint\";\n\nconst RULES_ESLINT_NURSERY = {\n \"getter-return\": \"error\",\n \"no-
|
|
1
|
+
{"version":3,"file":"eslint.mjs","names":[],"sources":["../../../../src/presets/common/rules/eslint.ts"],"sourcesContent":["import type { LintRules } from \"#/@types/oxlint\";\n\nconst RULES_ESLINT_NURSERY = {\n \"getter-return\": \"error\",\n \"no-unreachable\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_ESLINT_PEDANTIC = {\n eqeqeq: [\n \"error\",\n \"always\",\n ],\n \"no-array-constructor\": \"error\",\n \"no-case-declarations\": \"error\",\n \"no-constructor-return\": \"error\",\n \"no-else-return\": [\n \"error\",\n {\n allowElseIf: false,\n },\n ],\n \"no-fallthrough\": [\n \"error\",\n {\n allowEmptyCase: true,\n },\n ],\n \"no-loop-func\": \"error\",\n \"no-new-wrappers\": \"error\",\n \"no-object-constructor\": \"error\",\n \"no-promise-executor-return\": [\n \"error\",\n {\n allowVoid: false,\n },\n ],\n \"no-redeclare\": [\n \"error\",\n {\n builtinGlobals: true,\n },\n ],\n \"no-useless-return\": \"error\",\n radix: \"error\",\n} as const satisfies LintRules;\n\nconst RULES_ESLINT_PERF = {\n \"no-useless-call\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_ESLINT_RESTRICTION = {\n \"no-div-regex\": \"error\",\n \"no-undefined\": \"error\",\n \"no-use-before-define\": [\n \"error\",\n {\n allowNamedExports: true,\n classes: true,\n enums: true,\n functions: false,\n ignoreTypeReferences: true,\n typedefs: true,\n variables: false,\n },\n ],\n \"no-var\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_ESLINT_STYLE = {\n \"default-case-last\": \"error\",\n \"grouped-accessor-pairs\": [\n \"error\",\n \"getBeforeSet\",\n {\n enforceForTSTypes: true,\n },\n ],\n \"no-extra-label\": \"error\",\n \"no-implicit-coercion\": \"error\",\n \"no-label-var\": \"error\",\n \"no-multi-assign\": [\n \"error\",\n {\n ignoreNonDeclaration: false,\n },\n ],\n \"no-template-curly-in-string\": \"error\",\n \"no-useless-computed-key\": [\n \"error\",\n {\n enforceForClassMembers: true,\n },\n ],\n \"prefer-const\": [\n \"error\",\n {\n destructuring: \"all\",\n // avoid conflicts with `no-use-before-define`\n ignoreReadBeforeAssign: true,\n },\n ],\n \"prefer-promise-reject-errors\": [\n \"error\",\n {\n allowEmptyReject: false,\n },\n ],\n \"prefer-rest-params\": \"error\",\n \"prefer-spread\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_ESLINT_SUSPICIOUS = {\n \"block-scoped-var\": \"error\",\n \"no-extend-native\": \"error\",\n \"no-shadow\": [\n \"error\",\n {\n builtinGlobals: false,\n hoist: \"all\",\n ignoreFunctionTypeParameterNameValueShadow: false,\n ignoreOnInitialization: false,\n ignoreTypeValueShadow: false,\n },\n ],\n \"no-unexpected-multiline\": \"error\",\n \"no-unneeded-ternary\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_ESLINT = {\n ...RULES_ESLINT_NURSERY,\n ...RULES_ESLINT_PEDANTIC,\n ...RULES_ESLINT_PERF,\n ...RULES_ESLINT_RESTRICTION,\n ...RULES_ESLINT_STYLE,\n ...RULES_ESLINT_SUSPICIOUS,\n} as const satisfies LintRules;\n\nexport {\n RULES_ESLINT,\n RULES_ESLINT_NURSERY,\n RULES_ESLINT_PEDANTIC,\n RULES_ESLINT_PERF,\n RULES_ESLINT_RESTRICTION,\n RULES_ESLINT_STYLE,\n RULES_ESLINT_SUSPICIOUS,\n};\n"],"mappings":"AAEA,MAAM,uBAAuB;CACzB,iBAAiB;CACjB,kBAAkB;AACtB;AAEA,MAAM,wBAAwB;CAC1B,QAAQ,CACJ,SACA,QACJ;CACA,wBAAwB;CACxB,wBAAwB;CACxB,yBAAyB;CACzB,kBAAkB,CACd,SACA,EACI,aAAa,MACjB,CACJ;CACA,kBAAkB,CACd,SACA,EACI,gBAAgB,KACpB,CACJ;CACA,gBAAgB;CAChB,mBAAmB;CACnB,yBAAyB;CACzB,8BAA8B,CAC1B,SACA,EACI,WAAW,MACf,CACJ;CACA,gBAAgB,CACZ,SACA,EACI,gBAAgB,KACpB,CACJ;CACA,qBAAqB;CACrB,OAAO;AACX;AAEA,MAAM,oBAAoB,EACtB,mBAAmB,QACvB;AAEA,MAAM,2BAA2B;CAC7B,gBAAgB;CAChB,gBAAgB;CAChB,wBAAwB,CACpB,SACA;EACI,mBAAmB;EACnB,SAAS;EACT,OAAO;EACP,WAAW;EACX,sBAAsB;EACtB,UAAU;EACV,WAAW;CACf,CACJ;CACA,UAAU;AACd;AAEA,MAAM,qBAAqB;CACvB,qBAAqB;CACrB,0BAA0B;EACtB;EACA;EACA,EACI,mBAAmB,KACvB;CACJ;CACA,kBAAkB;CAClB,wBAAwB;CACxB,gBAAgB;CAChB,mBAAmB,CACf,SACA,EACI,sBAAsB,MAC1B,CACJ;CACA,+BAA+B;CAC/B,2BAA2B,CACvB,SACA,EACI,wBAAwB,KAC5B,CACJ;CACA,gBAAgB,CACZ,SACA;EACI,eAAe;EAEf,wBAAwB;CAC5B,CACJ;CACA,gCAAgC,CAC5B,SACA,EACI,kBAAkB,MACtB,CACJ;CACA,sBAAsB;CACtB,iBAAiB;AACrB;AAEA,MAAM,0BAA0B;CAC5B,oBAAoB;CACpB,oBAAoB;CACpB,aAAa,CACT,SACA;EACI,gBAAgB;EAChB,OAAO;EACP,4CAA4C;EAC5C,wBAAwB;EACxB,uBAAuB;CAC3B,CACJ;CACA,2BAA2B;CAC3B,uBAAuB;AAC3B;AAEA,MAAM,eAAe;CACjB,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;AACP"}
|
|
@@ -10,6 +10,10 @@ declare const RULES_IMPORT_RESTRICTION: {
|
|
|
10
10
|
readonly "import/extensions": ["error", "always", {
|
|
11
11
|
readonly js: "never";
|
|
12
12
|
readonly ts: "never";
|
|
13
|
+
readonly mjs: "never";
|
|
14
|
+
readonly mts: "never";
|
|
15
|
+
readonly cjs: "never";
|
|
16
|
+
readonly cts: "never";
|
|
13
17
|
readonly jsx: "never";
|
|
14
18
|
readonly tsx: "never";
|
|
15
19
|
readonly checkTypeImports: true;
|
|
@@ -19,9 +23,7 @@ declare const RULES_IMPORT_RESTRICTION: {
|
|
|
19
23
|
};
|
|
20
24
|
declare const RULES_IMPORT_STYLE: {
|
|
21
25
|
readonly "import/consistent-type-specifier-style": ["error", "prefer-top-level"];
|
|
22
|
-
readonly "import/exports-last": "error";
|
|
23
26
|
readonly "import/first": "error";
|
|
24
|
-
readonly "import/group-exports": "error";
|
|
25
27
|
readonly "import/no-duplicates": ["error", {
|
|
26
28
|
readonly considerQueryString: true;
|
|
27
29
|
readonly preferInline: false;
|
|
@@ -38,9 +40,7 @@ declare const RULES_IMPORT: {
|
|
|
38
40
|
readonly "import/no-named-as-default": "error";
|
|
39
41
|
readonly "import/no-self-import": "error";
|
|
40
42
|
readonly "import/consistent-type-specifier-style": ["error", "prefer-top-level"];
|
|
41
|
-
readonly "import/exports-last": "error";
|
|
42
43
|
readonly "import/first": "error";
|
|
43
|
-
readonly "import/group-exports": "error";
|
|
44
44
|
readonly "import/no-duplicates": ["error", {
|
|
45
45
|
readonly considerQueryString: true;
|
|
46
46
|
readonly preferInline: false;
|
|
@@ -49,6 +49,10 @@ declare const RULES_IMPORT: {
|
|
|
49
49
|
readonly "import/extensions": ["error", "always", {
|
|
50
50
|
readonly js: "never";
|
|
51
51
|
readonly ts: "never";
|
|
52
|
+
readonly mjs: "never";
|
|
53
|
+
readonly mts: "never";
|
|
54
|
+
readonly cjs: "never";
|
|
55
|
+
readonly cts: "never";
|
|
52
56
|
readonly jsx: "never";
|
|
53
57
|
readonly tsx: "never";
|
|
54
58
|
readonly checkTypeImports: true;
|
|
@@ -14,6 +14,10 @@ const RULES_IMPORT_RESTRICTION = {
|
|
|
14
14
|
{
|
|
15
15
|
js: "never",
|
|
16
16
|
ts: "never",
|
|
17
|
+
mjs: "never",
|
|
18
|
+
mts: "never",
|
|
19
|
+
cjs: "never",
|
|
20
|
+
cts: "never",
|
|
17
21
|
jsx: "never",
|
|
18
22
|
tsx: "never",
|
|
19
23
|
checkTypeImports: true,
|
|
@@ -24,9 +28,7 @@ const RULES_IMPORT_RESTRICTION = {
|
|
|
24
28
|
};
|
|
25
29
|
const RULES_IMPORT_STYLE = {
|
|
26
30
|
"import/consistent-type-specifier-style": ["error", "prefer-top-level"],
|
|
27
|
-
"import/exports-last": "error",
|
|
28
31
|
"import/first": "error",
|
|
29
|
-
"import/group-exports": "error",
|
|
30
32
|
"import/no-duplicates": ["error", {
|
|
31
33
|
considerQueryString: true,
|
|
32
34
|
preferInline: false
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import.js","names":[],"sources":["../../../../src/presets/common/rules/import.ts"],"sourcesContent":["import type { LintRules } from \"#/@types/oxlint\";\n\nconst RULES_IMPORT_CORRECTNESS = {\n \"import/default\": \"error\",\n \"import/namespace\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_IMPORT_NURSERY = {\n \"import/export\": \"error\",\n \"import/named\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_IMPORT_RESTRICTION = {\n \"import/extensions\": [\n \"error\",\n \"always\",\n {\n // source\n js: \"never\",\n ts: \"never\",\n jsx: \"never\",\n tsx: \"never\",\n // configurations\n checkTypeImports: true,\n ignorePackages: true,\n },\n ],\n \"import/no-cycle\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_IMPORT_STYLE = {\n \"import/consistent-type-specifier-style\": [\n \"error\",\n \"prefer-top-level\",\n ],\n \"import/
|
|
1
|
+
{"version":3,"file":"import.js","names":[],"sources":["../../../../src/presets/common/rules/import.ts"],"sourcesContent":["import type { LintRules } from \"#/@types/oxlint\";\n\nconst RULES_IMPORT_CORRECTNESS = {\n \"import/default\": \"error\",\n \"import/namespace\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_IMPORT_NURSERY = {\n \"import/export\": \"error\",\n \"import/named\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_IMPORT_RESTRICTION = {\n \"import/extensions\": [\n \"error\",\n \"always\",\n {\n // source\n js: \"never\",\n ts: \"never\",\n mjs: \"never\",\n mts: \"never\",\n cjs: \"never\",\n cts: \"never\",\n jsx: \"never\",\n tsx: \"never\",\n // configurations\n checkTypeImports: true,\n ignorePackages: true,\n },\n ],\n \"import/no-cycle\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_IMPORT_STYLE = {\n \"import/consistent-type-specifier-style\": [\n \"error\",\n \"prefer-top-level\",\n ],\n \"import/first\": \"error\",\n \"import/no-duplicates\": [\n \"error\",\n {\n considerQueryString: true,\n preferInline: false,\n },\n ],\n \"import/no-mutable-exports\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_IMPORT_SUSPICIOUS = {\n \"import/no-empty-named-blocks\": \"error\",\n \"import/no-named-as-default\": \"error\",\n \"import/no-self-import\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_IMPORT = {\n ...RULES_IMPORT_CORRECTNESS,\n ...RULES_IMPORT_NURSERY,\n ...RULES_IMPORT_RESTRICTION,\n ...RULES_IMPORT_STYLE,\n ...RULES_IMPORT_SUSPICIOUS,\n} as const satisfies LintRules;\n\nexport {\n RULES_IMPORT,\n RULES_IMPORT_CORRECTNESS,\n RULES_IMPORT_NURSERY,\n RULES_IMPORT_RESTRICTION,\n RULES_IMPORT_STYLE,\n RULES_IMPORT_SUSPICIOUS,\n};\n"],"mappings":";AAEA,MAAM,2BAA2B;CAC7B,kBAAkB;CAClB,oBAAoB;AACxB;AAEA,MAAM,uBAAuB;CACzB,iBAAiB;CACjB,gBAAgB;AACpB;AAEA,MAAM,2BAA2B;CAC7B,qBAAqB;EACjB;EACA;EACA;GAEI,IAAI;GACJ,IAAI;GACJ,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GAEL,kBAAkB;GAClB,gBAAgB;EACpB;CACJ;CACA,mBAAmB;AACvB;AAEA,MAAM,qBAAqB;CACvB,0CAA0C,CACtC,SACA,kBACJ;CACA,gBAAgB;CAChB,wBAAwB,CACpB,SACA;EACI,qBAAqB;EACrB,cAAc;CAClB,CACJ;CACA,6BAA6B;AACjC;AAEA,MAAM,0BAA0B;CAC5B,gCAAgC;CAChC,8BAA8B;CAC9B,yBAAyB;AAC7B;AAEA,MAAM,eAAe;CACjB,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;AACP"}
|
|
@@ -13,6 +13,10 @@ const RULES_IMPORT_RESTRICTION = {
|
|
|
13
13
|
{
|
|
14
14
|
js: "never",
|
|
15
15
|
ts: "never",
|
|
16
|
+
mjs: "never",
|
|
17
|
+
mts: "never",
|
|
18
|
+
cjs: "never",
|
|
19
|
+
cts: "never",
|
|
16
20
|
jsx: "never",
|
|
17
21
|
tsx: "never",
|
|
18
22
|
checkTypeImports: true,
|
|
@@ -23,9 +27,7 @@ const RULES_IMPORT_RESTRICTION = {
|
|
|
23
27
|
};
|
|
24
28
|
const RULES_IMPORT_STYLE = {
|
|
25
29
|
"import/consistent-type-specifier-style": ["error", "prefer-top-level"],
|
|
26
|
-
"import/exports-last": "error",
|
|
27
30
|
"import/first": "error",
|
|
28
|
-
"import/group-exports": "error",
|
|
29
31
|
"import/no-duplicates": ["error", {
|
|
30
32
|
considerQueryString: true,
|
|
31
33
|
preferInline: false
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import.mjs","names":[],"sources":["../../../../src/presets/common/rules/import.ts"],"sourcesContent":["import type { LintRules } from \"#/@types/oxlint\";\n\nconst RULES_IMPORT_CORRECTNESS = {\n \"import/default\": \"error\",\n \"import/namespace\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_IMPORT_NURSERY = {\n \"import/export\": \"error\",\n \"import/named\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_IMPORT_RESTRICTION = {\n \"import/extensions\": [\n \"error\",\n \"always\",\n {\n // source\n js: \"never\",\n ts: \"never\",\n jsx: \"never\",\n tsx: \"never\",\n // configurations\n checkTypeImports: true,\n ignorePackages: true,\n },\n ],\n \"import/no-cycle\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_IMPORT_STYLE = {\n \"import/consistent-type-specifier-style\": [\n \"error\",\n \"prefer-top-level\",\n ],\n \"import/
|
|
1
|
+
{"version":3,"file":"import.mjs","names":[],"sources":["../../../../src/presets/common/rules/import.ts"],"sourcesContent":["import type { LintRules } from \"#/@types/oxlint\";\n\nconst RULES_IMPORT_CORRECTNESS = {\n \"import/default\": \"error\",\n \"import/namespace\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_IMPORT_NURSERY = {\n \"import/export\": \"error\",\n \"import/named\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_IMPORT_RESTRICTION = {\n \"import/extensions\": [\n \"error\",\n \"always\",\n {\n // source\n js: \"never\",\n ts: \"never\",\n mjs: \"never\",\n mts: \"never\",\n cjs: \"never\",\n cts: \"never\",\n jsx: \"never\",\n tsx: \"never\",\n // configurations\n checkTypeImports: true,\n ignorePackages: true,\n },\n ],\n \"import/no-cycle\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_IMPORT_STYLE = {\n \"import/consistent-type-specifier-style\": [\n \"error\",\n \"prefer-top-level\",\n ],\n \"import/first\": \"error\",\n \"import/no-duplicates\": [\n \"error\",\n {\n considerQueryString: true,\n preferInline: false,\n },\n ],\n \"import/no-mutable-exports\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_IMPORT_SUSPICIOUS = {\n \"import/no-empty-named-blocks\": \"error\",\n \"import/no-named-as-default\": \"error\",\n \"import/no-self-import\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_IMPORT = {\n ...RULES_IMPORT_CORRECTNESS,\n ...RULES_IMPORT_NURSERY,\n ...RULES_IMPORT_RESTRICTION,\n ...RULES_IMPORT_STYLE,\n ...RULES_IMPORT_SUSPICIOUS,\n} as const satisfies LintRules;\n\nexport {\n RULES_IMPORT,\n RULES_IMPORT_CORRECTNESS,\n RULES_IMPORT_NURSERY,\n RULES_IMPORT_RESTRICTION,\n RULES_IMPORT_STYLE,\n RULES_IMPORT_SUSPICIOUS,\n};\n"],"mappings":"AAEA,MAAM,2BAA2B;CAC7B,kBAAkB;CAClB,oBAAoB;AACxB;AAEA,MAAM,uBAAuB;CACzB,iBAAiB;CACjB,gBAAgB;AACpB;AAEA,MAAM,2BAA2B;CAC7B,qBAAqB;EACjB;EACA;EACA;GAEI,IAAI;GACJ,IAAI;GACJ,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GAEL,kBAAkB;GAClB,gBAAgB;EACpB;CACJ;CACA,mBAAmB;AACvB;AAEA,MAAM,qBAAqB;CACvB,0CAA0C,CACtC,SACA,kBACJ;CACA,gBAAgB;CAChB,wBAAwB,CACpB,SACA;EACI,qBAAqB;EACrB,cAAc;CAClB,CACJ;CACA,6BAA6B;AACjC;AAEA,MAAM,0BAA0B;CAC5B,gCAAgC;CAChC,8BAA8B;CAC9B,yBAAyB;AAC7B;AAEA,MAAM,eAAe;CACjB,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;AACP"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oxc.js","names":[],"sources":["../../../../src/presets/common/rules/oxc.ts"],"sourcesContent":["import type { LintRules } from \"#/@types/oxlint\";\n\nconst RULES_OXC_NURSERY = {\n \"oxc/branches-sharing-code\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_OXC_RESTRICTION = {\n \"oxc/no-const-enum\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_OXC_SUSPICIOUS = {\n \"oxc/approx-constant\": \"error\",\n \"oxc/misrefactored-assign-op\": \"error\",\n \"oxc/no-this-in-exported-function\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_OXC = {\n ...RULES_OXC_NURSERY,\n ...RULES_OXC_RESTRICTION,\n ...RULES_OXC_SUSPICIOUS,\n} as const satisfies LintRules;\n\nexport { RULES_OXC, RULES_OXC_NURSERY, RULES_OXC_RESTRICTION };\n"],"mappings":";AAEA,MAAM,oBAAoB,EACtB,6BAA6B,
|
|
1
|
+
{"version":3,"file":"oxc.js","names":[],"sources":["../../../../src/presets/common/rules/oxc.ts"],"sourcesContent":["import type { LintRules } from \"#/@types/oxlint\";\n\nconst RULES_OXC_NURSERY = {\n \"oxc/branches-sharing-code\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_OXC_RESTRICTION = {\n \"oxc/no-const-enum\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_OXC_SUSPICIOUS = {\n \"oxc/approx-constant\": \"error\",\n \"oxc/misrefactored-assign-op\": \"error\",\n \"oxc/no-this-in-exported-function\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_OXC = {\n ...RULES_OXC_NURSERY,\n ...RULES_OXC_RESTRICTION,\n ...RULES_OXC_SUSPICIOUS,\n} as const satisfies LintRules;\n\nexport { RULES_OXC, RULES_OXC_NURSERY, RULES_OXC_RESTRICTION };\n"],"mappings":";AAEA,MAAM,oBAAoB,EACtB,6BAA6B,QACjC;AAEA,MAAM,wBAAwB,EAC1B,qBAAqB,QACzB;AAEA,MAAM,uBAAuB;CACzB,uBAAuB;CACvB,+BAA+B;CAC/B,oCAAoC;AACxC;AAEA,MAAM,YAAY;CACd,GAAG;CACH,GAAG;CACH,GAAG;AACP"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oxc.mjs","names":[],"sources":["../../../../src/presets/common/rules/oxc.ts"],"sourcesContent":["import type { LintRules } from \"#/@types/oxlint\";\n\nconst RULES_OXC_NURSERY = {\n \"oxc/branches-sharing-code\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_OXC_RESTRICTION = {\n \"oxc/no-const-enum\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_OXC_SUSPICIOUS = {\n \"oxc/approx-constant\": \"error\",\n \"oxc/misrefactored-assign-op\": \"error\",\n \"oxc/no-this-in-exported-function\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_OXC = {\n ...RULES_OXC_NURSERY,\n ...RULES_OXC_RESTRICTION,\n ...RULES_OXC_SUSPICIOUS,\n} as const satisfies LintRules;\n\nexport { RULES_OXC, RULES_OXC_NURSERY, RULES_OXC_RESTRICTION };\n"],"mappings":"AAEA,MAAM,oBAAoB,EACtB,6BAA6B,
|
|
1
|
+
{"version":3,"file":"oxc.mjs","names":[],"sources":["../../../../src/presets/common/rules/oxc.ts"],"sourcesContent":["import type { LintRules } from \"#/@types/oxlint\";\n\nconst RULES_OXC_NURSERY = {\n \"oxc/branches-sharing-code\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_OXC_RESTRICTION = {\n \"oxc/no-const-enum\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_OXC_SUSPICIOUS = {\n \"oxc/approx-constant\": \"error\",\n \"oxc/misrefactored-assign-op\": \"error\",\n \"oxc/no-this-in-exported-function\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_OXC = {\n ...RULES_OXC_NURSERY,\n ...RULES_OXC_RESTRICTION,\n ...RULES_OXC_SUSPICIOUS,\n} as const satisfies LintRules;\n\nexport { RULES_OXC, RULES_OXC_NURSERY, RULES_OXC_RESTRICTION };\n"],"mappings":"AAEA,MAAM,oBAAoB,EACtB,6BAA6B,QACjC;AAEA,MAAM,wBAAwB,EAC1B,qBAAqB,QACzB;AAEA,MAAM,uBAAuB;CACzB,uBAAuB;CACvB,+BAA+B;CAC/B,oCAAoC;AACxC;AAEA,MAAM,YAAY;CACd,GAAG;CACH,GAAG;CACH,GAAG;AACP"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promise.js","names":[],"sources":["../../../../src/presets/common/rules/promise.ts"],"sourcesContent":["import type { LintRules } from \"#/@types/oxlint\";\n\nconst RULES_PROMISE_CORRECTNESS = {\n \"promise/no-new-statics\": \"error\",\n \"promise/valid-params\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_PROMISE_NURSERY = {\n \"promise/no-return-in-finally\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_PROMISE_RESTRICTION = {\n \"promise/catch-or-return\": [\n \"error\",\n {\n allowFinally: true,\n allowThen: false,\n },\n ],\n \"promise/spec-only\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_PROMISE_STYLE = {\n \"promise/prefer-catch\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_PROMISE_SUSPICIOUS = {\n \"promise/no-multiple-resolved\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_PROMISE = {\n ...RULES_PROMISE_CORRECTNESS,\n ...RULES_PROMISE_NURSERY,\n ...RULES_PROMISE_RESTRICTION,\n ...RULES_PROMISE_STYLE,\n ...RULES_PROMISE_SUSPICIOUS,\n} as const satisfies LintRules;\n\nexport {\n RULES_PROMISE,\n RULES_PROMISE_CORRECTNESS,\n RULES_PROMISE_NURSERY,\n RULES_PROMISE_RESTRICTION,\n RULES_PROMISE_STYLE,\n RULES_PROMISE_SUSPICIOUS,\n};\n"],"mappings":";AAEA,MAAM,4BAA4B;CAC9B,0BAA0B;CAC1B,wBAAwB;
|
|
1
|
+
{"version":3,"file":"promise.js","names":[],"sources":["../../../../src/presets/common/rules/promise.ts"],"sourcesContent":["import type { LintRules } from \"#/@types/oxlint\";\n\nconst RULES_PROMISE_CORRECTNESS = {\n \"promise/no-new-statics\": \"error\",\n \"promise/valid-params\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_PROMISE_NURSERY = {\n \"promise/no-return-in-finally\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_PROMISE_RESTRICTION = {\n \"promise/catch-or-return\": [\n \"error\",\n {\n allowFinally: true,\n allowThen: false,\n },\n ],\n \"promise/spec-only\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_PROMISE_STYLE = {\n \"promise/prefer-catch\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_PROMISE_SUSPICIOUS = {\n \"promise/no-multiple-resolved\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_PROMISE = {\n ...RULES_PROMISE_CORRECTNESS,\n ...RULES_PROMISE_NURSERY,\n ...RULES_PROMISE_RESTRICTION,\n ...RULES_PROMISE_STYLE,\n ...RULES_PROMISE_SUSPICIOUS,\n} as const satisfies LintRules;\n\nexport {\n RULES_PROMISE,\n RULES_PROMISE_CORRECTNESS,\n RULES_PROMISE_NURSERY,\n RULES_PROMISE_RESTRICTION,\n RULES_PROMISE_STYLE,\n RULES_PROMISE_SUSPICIOUS,\n};\n"],"mappings":";AAEA,MAAM,4BAA4B;CAC9B,0BAA0B;CAC1B,wBAAwB;AAC5B;AAEA,MAAM,wBAAwB,EAC1B,gCAAgC,QACpC;AAEA,MAAM,4BAA4B;CAC9B,2BAA2B,CACvB,SACA;EACI,cAAc;EACd,WAAW;CACf,CACJ;CACA,qBAAqB;AACzB;AAEA,MAAM,sBAAsB,EACxB,wBAAwB,QAC5B;AAEA,MAAM,2BAA2B,EAC7B,gCAAgC,QACpC;AAEA,MAAM,gBAAgB;CAClB,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;AACP"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promise.mjs","names":[],"sources":["../../../../src/presets/common/rules/promise.ts"],"sourcesContent":["import type { LintRules } from \"#/@types/oxlint\";\n\nconst RULES_PROMISE_CORRECTNESS = {\n \"promise/no-new-statics\": \"error\",\n \"promise/valid-params\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_PROMISE_NURSERY = {\n \"promise/no-return-in-finally\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_PROMISE_RESTRICTION = {\n \"promise/catch-or-return\": [\n \"error\",\n {\n allowFinally: true,\n allowThen: false,\n },\n ],\n \"promise/spec-only\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_PROMISE_STYLE = {\n \"promise/prefer-catch\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_PROMISE_SUSPICIOUS = {\n \"promise/no-multiple-resolved\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_PROMISE = {\n ...RULES_PROMISE_CORRECTNESS,\n ...RULES_PROMISE_NURSERY,\n ...RULES_PROMISE_RESTRICTION,\n ...RULES_PROMISE_STYLE,\n ...RULES_PROMISE_SUSPICIOUS,\n} as const satisfies LintRules;\n\nexport {\n RULES_PROMISE,\n RULES_PROMISE_CORRECTNESS,\n RULES_PROMISE_NURSERY,\n RULES_PROMISE_RESTRICTION,\n RULES_PROMISE_STYLE,\n RULES_PROMISE_SUSPICIOUS,\n};\n"],"mappings":"AAEA,MAAM,4BAA4B;CAC9B,0BAA0B;CAC1B,wBAAwB;
|
|
1
|
+
{"version":3,"file":"promise.mjs","names":[],"sources":["../../../../src/presets/common/rules/promise.ts"],"sourcesContent":["import type { LintRules } from \"#/@types/oxlint\";\n\nconst RULES_PROMISE_CORRECTNESS = {\n \"promise/no-new-statics\": \"error\",\n \"promise/valid-params\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_PROMISE_NURSERY = {\n \"promise/no-return-in-finally\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_PROMISE_RESTRICTION = {\n \"promise/catch-or-return\": [\n \"error\",\n {\n allowFinally: true,\n allowThen: false,\n },\n ],\n \"promise/spec-only\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_PROMISE_STYLE = {\n \"promise/prefer-catch\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_PROMISE_SUSPICIOUS = {\n \"promise/no-multiple-resolved\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_PROMISE = {\n ...RULES_PROMISE_CORRECTNESS,\n ...RULES_PROMISE_NURSERY,\n ...RULES_PROMISE_RESTRICTION,\n ...RULES_PROMISE_STYLE,\n ...RULES_PROMISE_SUSPICIOUS,\n} as const satisfies LintRules;\n\nexport {\n RULES_PROMISE,\n RULES_PROMISE_CORRECTNESS,\n RULES_PROMISE_NURSERY,\n RULES_PROMISE_RESTRICTION,\n RULES_PROMISE_STYLE,\n RULES_PROMISE_SUSPICIOUS,\n};\n"],"mappings":"AAEA,MAAM,4BAA4B;CAC9B,0BAA0B;CAC1B,wBAAwB;AAC5B;AAEA,MAAM,wBAAwB,EAC1B,gCAAgC,QACpC;AAEA,MAAM,4BAA4B;CAC9B,2BAA2B,CACvB,SACA;EACI,cAAc;EACd,WAAW;CACf,CACJ;CACA,qBAAqB;AACzB;AAEA,MAAM,sBAAsB,EACxB,wBAAwB,QAC5B;AAEA,MAAM,2BAA2B,EAC7B,gCAAgC,QACpC;AAEA,MAAM,gBAAgB;CAClB,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;AACP"}
|