@truenine/eslint9-config 1.0.17 → 1.0.19
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/defaults/index.d.ts.map +1 -1
- package/dist/defaults/index.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +16 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":["defaultUnocssConfig: AntFuUnocssConfig","defaultVueConfig: AntFuVueConfig","defaultJsConfig: AntFuJsConfig","defaultTsConfig: AntFuTsConfig","defaultFormatterConfig: AntFuFormatterConfig","defaultStrictTsConfig: AntFuTsConfig","defaultStylisticConfig: AntFuStylisticConfig","defaultTestConfig: AntFuTestConfig"],"sources":["../../src/defaults/index.ts"],"sourcesContent":[],"mappings":";;;cAEaA,qBAAqB;cAKrBC,kBAAkB;AALlBD,cAyEAE,eAzEqB,EAyEJ,aAzEI;AAKrBD,cA2FAE,eA3FkB,EA2FD,aA3FC;AAoElBD,cAgDAE,sBAhDiB,EAgDO,oBAhDP;AAuB9B;AAyBA;AAsBA;AAUA;AAYA;AA8BA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":["defaultUnocssConfig: AntFuUnocssConfig","defaultVueConfig: AntFuVueConfig","defaultJsConfig: AntFuJsConfig","defaultTsConfig: AntFuTsConfig","defaultFormatterConfig: AntFuFormatterConfig","defaultStrictTsConfig: AntFuTsConfig","defaultStylisticConfig: AntFuStylisticConfig","defaultTestConfig: AntFuTestConfig"],"sources":["../../src/defaults/index.ts"],"sourcesContent":[],"mappings":";;;cAEaA,qBAAqB;cAKrBC,kBAAkB;AALlBD,cAyEAE,eAzEqB,EAyEJ,aAzEI;AAKrBD,cA2FAE,eA3FkB,EA2FD,aA3FC;AAoElBD,cAgDAE,sBAhDiB,EAgDO,oBAhDP;AAuB9B;AAyBA;AAsBA;AAUA;AAYA;AA8BA;AACoB,cArDPC,qBAqDO,EArDgB,aAqDhB;AACP,cA5CAC,sBA4CA,EA5CwB,oBA4CxB;AACV,cAjCUC,iBAiCV,EAjC6B,eAiC7B;;AACH;;;;;;;;;;;;;;;;;iBAJgB,sDACI,qBACP,IACV;iBACa,sDACI,yCAEP"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["defaultUnocssConfig: AntFuUnocssConfig","defaultVueConfig: AntFuVueConfig","defaultJsConfig: AntFuJsConfig","defaultTsConfig: AntFuTsConfig","defaultFormatterConfig: AntFuFormatterConfig","defaultStrictTsConfig: AntFuTsConfig","defaultStylisticConfig: AntFuStylisticConfig","defaultTestConfig: AntFuTestConfig"],"sources":["../../src/defaults/index.ts"],"sourcesContent":["import type { AntFuFormatterConfig, AntFuJsConfig, AntFuStylisticConfig, AntFuTestConfig, AntFuTsConfig, AntFuUnocssConfig, AntFuVueConfig } from '../types'\n\nexport const defaultUnocssConfig: AntFuUnocssConfig = {\n attributify: true,\n strict: true,\n}\n\nexport const defaultVueConfig: AntFuVueConfig = {\n vueVersion: 3,\n overrides: {\n 'vue/html-self-closing': ['error', {\n html: {\n void: 'always',\n normal: 'always',\n component: 'always',\n },\n }],\n 'vue/html-comment-content-spacing': ['error', 'always', { exceptions: [] }],\n 'vue/html-comment-indent': ['error', 2],\n 'vue/html-indent': ['error', 2, {\n baseIndent: 0,\n alignAttributesVertically: true,\n }],\n 'vue/define-emits-declaration': ['error', 'type-literal'],\n 'vue/define-props-declaration': ['error', 'type-based'],\n 'vue/define-macros-order': [\n 'error',\n {\n order: [\n 'defineProps',\n 'defineEmits',\n 'defineModel',\n 'defineSlots',\n ],\n defineExposeLast: true,\n },\n ],\n 'vue/block-order': [\n 'error',\n {\n order: ['script', 'template', 'style'],\n },\n ],\n 'vue/attributes-order': [\n 'error',\n {\n order: ['DEFINITION', 'LIST_RENDERING', 'CONDITIONALS', 'RENDER_MODIFIERS', 'GLOBAL', 'UNIQUE', 'TWO_WAY_BINDING', 'OTHER_DIRECTIVES', 'OTHER_ATTR', 'EVENTS', 'CONTENT'],\n },\n ],\n 'vue/v-on-event-hyphenation': [\n 'error',\n 'never',\n {\n autofix: true,\n },\n ],\n 'vue/attribute-hyphenation': [\n 'error',\n 'never',\n {\n ignoreTags: ['i-', 'v-', 'v-bind'],\n },\n ],\n 'vue/prop-name-casing': ['error', 'camelCase'],\n 'vue/component-name-in-template-casing': [\n 'error',\n 'PascalCase',\n {\n ignores: ['router-view', 'router-link', 'scroll-view'],\n registeredComponentsOnly: false,\n },\n ],\n },\n}\n\nexport const defaultJsConfig: AntFuJsConfig = {\n overrides: {\n 'no-inline-comments': 'error',\n 'unicorn/no-useless-spread': 'error',\n\n 'curly': ['error', 'all'],\n 'no-undefined': 'error',\n 'no-cond-assign': ['error', 'always'],\n 'no-constant-condition': 'error',\n 'no-restricted-syntax': 'error',\n 'no-global-assign': 'error',\n 'no-unused-vars': 'error',\n 'no-var': 'error',\n 'prefer-const': [\n 'error',\n {\n destructuring: 'any',\n ignoreReadBeforeAssign: false,\n },\n ],\n },\n}\n\nexport const defaultTsConfig: AntFuTsConfig = {\n overrides: {\n 'ts/no-unsafe-assignment': 'off',\n 'ts/no-unsafe-call': 'off',\n 'ts/no-unsafe-argument': 'off',\n 'ts/no-unsafe-return': 'off',\n 'ts/member-ordering': ['error'],\n 'ts/no-extra-non-null-assertion': 'error',\n 'ts/no-non-null-assertion': 'error',\n 'ts/no-explicit-any': ['error', {\n fixToUnknown: true,\n ignoreRestArgs: true,\n }],\n 'ts/no-namespace': 'error',\n 'ts/no-unused-vars': [\n 'error',\n {\n vars: 'all',\n args: 'after-used',\n ignoreRestSiblings: false,\n },\n ],\n },\n}\n\nexport const defaultFormatterConfig: AntFuFormatterConfig = {\n css: 'prettier',\n html: 'prettier',\n prettierOptions: {\n printWidth: 160,\n tabWidth: 2,\n arrowParens: 'always',\n vueIndentScriptAndStyle: true,\n useTabs: false,\n singleQuote: true,\n jsxSingleQuote: true,\n trailingComma: 'all',\n bracketSpacing: true,\n },\n}\n\n/**\n * 严格 ts 模式 的默认配置\n *\n * 这些配置需要 配置 parserOptions 和 tsconfigPath 等\n * @see https://typescript-eslint.io/getting-started/typed-linting\n */\nexport const defaultStrictTsConfig: AntFuTsConfig = {\n overrides: {\n 'ts/no-unsafe-assignment': 'off',\n 'ts/no-unsafe-call': 'off',\n 'ts/no-unsafe-argument': 'off',\n 'ts/no-unsafe-return': 'off',\n 'ts/no-floating-promises': 'error',\n },\n}\n\nexport const defaultStylisticConfig: AntFuStylisticConfig = {\n jsx: true,\n indent: 2,\n quotes: 'single',\n semi: false,\n overrides: {\n 'style/no-multiple-empty-lines': ['error', { max: 1, maxBOF: 0, maxEOF: 0 }],\n 'style/brace-style': ['error', '1tbs'],\n 'style/arrow-parens': ['error', 'always'],\n },\n}\n\nexport const defaultTestConfig: AntFuTestConfig = {\n overrides: {\n 'no-console': 'off',\n 'ts/unbound-method': 'off',\n 'ts/no-unsafe-argument': 'off',\n 'ts/no-unsafe-assignment': 'off',\n 'ts/no-unsafe-member-access': 'off',\n 'ts/no-unsafe-call': 'off',\n 'ts/no-unsafe-return': 'off',\n },\n}\n\n/**\n * 合并配置项,支持以下场景:\n * 1. 布尔值与对象配置的混合\n * 2. 使用 vite 的 mergeConfig 进行对象合并\n * 3. 处理 undefined 和 null 的默认值\n *\n * @example\n * ```ts\n * // 场景1: 布尔值转换为默认对象\n * mergeWithDefaults(true, { foo: 'bar' }) // => { foo: 'bar' }\n *\n * // 场景2: vite配置合并\n * mergeWithDefaults({ plugins: [vue()] }, { plugins: [unocss()] })\n *\n * // 场景3: undefined/null/false 处理\n * mergeWithDefaults(false, true) // => false\n * ```\n */\nexport function mergeWithDefaults<T extends object>(\n value?: boolean | T | null,\n defaults?: T
|
|
1
|
+
{"version":3,"file":"index.js","names":["defaultUnocssConfig: AntFuUnocssConfig","defaultVueConfig: AntFuVueConfig","defaultJsConfig: AntFuJsConfig","defaultTsConfig: AntFuTsConfig","defaultFormatterConfig: AntFuFormatterConfig","defaultStrictTsConfig: AntFuTsConfig","defaultStylisticConfig: AntFuStylisticConfig","defaultTestConfig: AntFuTestConfig"],"sources":["../../src/defaults/index.ts"],"sourcesContent":["import type { AntFuFormatterConfig, AntFuJsConfig, AntFuStylisticConfig, AntFuTestConfig, AntFuTsConfig, AntFuUnocssConfig, AntFuVueConfig } from '../types'\n\nexport const defaultUnocssConfig: AntFuUnocssConfig = {\n attributify: true,\n strict: true,\n}\n\nexport const defaultVueConfig: AntFuVueConfig = {\n vueVersion: 3,\n overrides: {\n 'vue/html-self-closing': ['error', {\n html: {\n void: 'always',\n normal: 'always',\n component: 'always',\n },\n }],\n 'vue/html-comment-content-spacing': ['error', 'always', { exceptions: [] }],\n 'vue/html-comment-indent': ['error', 2],\n 'vue/html-indent': ['error', 2, {\n baseIndent: 0,\n alignAttributesVertically: true,\n }],\n 'vue/define-emits-declaration': ['error', 'type-literal'],\n 'vue/define-props-declaration': ['error', 'type-based'],\n 'vue/define-macros-order': [\n 'error',\n {\n order: [\n 'defineProps',\n 'defineEmits',\n 'defineModel',\n 'defineSlots',\n ],\n defineExposeLast: true,\n },\n ],\n 'vue/block-order': [\n 'error',\n {\n order: ['script', 'template', 'style'],\n },\n ],\n 'vue/attributes-order': [\n 'error',\n {\n order: ['DEFINITION', 'LIST_RENDERING', 'CONDITIONALS', 'RENDER_MODIFIERS', 'GLOBAL', 'UNIQUE', 'TWO_WAY_BINDING', 'OTHER_DIRECTIVES', 'OTHER_ATTR', 'EVENTS', 'CONTENT'],\n },\n ],\n 'vue/v-on-event-hyphenation': [\n 'error',\n 'never',\n {\n autofix: true,\n },\n ],\n 'vue/attribute-hyphenation': [\n 'error',\n 'never',\n {\n ignoreTags: ['i-', 'v-', 'v-bind'],\n },\n ],\n 'vue/prop-name-casing': ['error', 'camelCase'],\n 'vue/component-name-in-template-casing': [\n 'error',\n 'PascalCase',\n {\n ignores: ['router-view', 'router-link', 'scroll-view'],\n registeredComponentsOnly: false,\n },\n ],\n },\n}\n\nexport const defaultJsConfig: AntFuJsConfig = {\n overrides: {\n 'no-inline-comments': 'error',\n 'unicorn/no-useless-spread': 'error',\n\n 'curly': ['error', 'all'],\n 'no-undefined': 'error',\n 'no-cond-assign': ['error', 'always'],\n 'no-constant-condition': 'error',\n 'no-restricted-syntax': 'error',\n 'no-global-assign': 'error',\n 'no-unused-vars': 'error',\n 'no-var': 'error',\n 'prefer-const': [\n 'error',\n {\n destructuring: 'any',\n ignoreReadBeforeAssign: false,\n },\n ],\n },\n}\n\nexport const defaultTsConfig: AntFuTsConfig = {\n overrides: {\n 'ts/no-unsafe-assignment': 'off',\n 'ts/no-unsafe-call': 'off',\n 'ts/no-unsafe-argument': 'off',\n 'ts/no-unsafe-return': 'off',\n 'ts/member-ordering': ['error'],\n 'ts/no-extra-non-null-assertion': 'error',\n 'ts/no-non-null-assertion': 'error',\n 'ts/no-explicit-any': ['error', {\n fixToUnknown: true,\n ignoreRestArgs: true,\n }],\n 'ts/no-namespace': 'error',\n 'ts/no-unused-vars': [\n 'error',\n {\n vars: 'all',\n args: 'after-used',\n ignoreRestSiblings: false,\n },\n ],\n },\n}\n\nexport const defaultFormatterConfig: AntFuFormatterConfig = {\n css: 'prettier',\n html: 'prettier',\n prettierOptions: {\n printWidth: 160,\n tabWidth: 2,\n arrowParens: 'always',\n vueIndentScriptAndStyle: true,\n useTabs: false,\n singleQuote: true,\n jsxSingleQuote: true,\n trailingComma: 'all',\n bracketSpacing: true,\n },\n}\n\n/**\n * 严格 ts 模式 的默认配置\n *\n * 这些配置需要 配置 parserOptions 和 tsconfigPath 等\n * @see https://typescript-eslint.io/getting-started/typed-linting\n */\nexport const defaultStrictTsConfig: AntFuTsConfig = {\n overrides: {\n 'ts/no-unsafe-assignment': 'off',\n 'ts/no-unsafe-call': 'off',\n 'ts/no-unsafe-argument': 'off',\n 'ts/no-unsafe-return': 'off',\n 'ts/no-floating-promises': 'error',\n },\n}\n\nexport const defaultStylisticConfig: AntFuStylisticConfig = {\n jsx: true,\n indent: 2,\n quotes: 'single',\n semi: false,\n overrides: {\n 'style/no-multiple-empty-lines': ['error', { max: 1, maxBOF: 0, maxEOF: 0 }],\n 'style/brace-style': ['error', '1tbs'],\n 'style/arrow-parens': ['error', 'always'],\n },\n}\n\nexport const defaultTestConfig: AntFuTestConfig = {\n overrides: {\n 'no-console': 'off',\n 'ts/unbound-method': 'off',\n 'ts/no-unsafe-argument': 'off',\n 'ts/no-unsafe-assignment': 'off',\n 'ts/no-unsafe-member-access': 'off',\n 'ts/no-unsafe-call': 'off',\n 'ts/no-unsafe-return': 'off',\n },\n}\n\n/**\n * 合并配置项,支持以下场景:\n * 1. 布尔值与对象配置的混合\n * 2. 使用 vite 的 mergeConfig 进行对象合并\n * 3. 处理 undefined 和 null 的默认值\n *\n * @example\n * ```ts\n * // 场景1: 布尔值转换为默认对象\n * mergeWithDefaults(true, { foo: 'bar' }) // => { foo: 'bar' }\n *\n * // 场景2: vite配置合并\n * mergeWithDefaults({ plugins: [vue()] }, { plugins: [unocss()] })\n *\n * // 场景3: undefined/null/false 处理\n * mergeWithDefaults(false, true) // => false\n * ```\n */\nexport function mergeWithDefaults<T extends object>(\n value?: boolean | T | null,\n defaults?: T,\n): T\nexport function mergeWithDefaults<T extends object>(\n value?: boolean | T | null,\n defaults?: boolean,\n): boolean | T\nexport function mergeWithDefaults<T extends object>(\n value?: boolean | T | null,\n defaults?: boolean | T | null,\n): boolean | T {\n // 处理无默认值的情况\n if (defaults === false || defaults === null || defaults === void 0) {\n if (value === true) {\n return true\n }\n if (value === false || value === null) {\n return false\n }\n return value as T\n }\n\n // 处理 value 为 undefined 的情况\n if (value === void 0) {\n return defaults\n }\n\n // 处理 value 为 false/null 的情况\n if (value === false || value === null) {\n return false\n }\n\n // 处理 value 为 true 的情况\n if (value === true) {\n return defaults\n }\n\n // 如果都是对象,使用 vite 的 mergeConfig 进行合并\n if (typeof value === 'object' && typeof defaults === 'object') {\n return {\n ...defaults,\n ...value,\n }\n }\n\n // 其他情况返回 value\n return value\n}\n"],"mappings":"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"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;UAKiB,aAAA;;EAAjB,IAAiB,CAAA,EAAA,OAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;UAKiB,aAAA;;EAAjB,IAAiB,CAAA,EAAA,OAAA;EAGE,IAAA,CAAA,EAAA,OAAA,GAAA,eAAA;EAKD,OAAA,CAAA,EAAA,MAAA,EAAA;EACO,GAAA,CAAA,EAAA,OAAA;EACV,MAAA,CAAA,EAAA,OAAA;EACU,KAAA,CAAA,EAAA,OAAA;EAAsB,GAAA,CAAA,EAAA,OAAA,GAH7B,cAG6B;EAC1B,UAAA,CAAA,EAAA,OAAA,GAHI,oBAGJ;EACG,UAAA,CAAA,EAHT,aAGS;EAAA,UAAA,CAAA,EAAA,OAAA,GAFC,mBAED,GAFuB,aAEvB;EAGxB,MAAsB,CAAA,EAAA,OAAA,GAJD,iBAIC;EAAqB,SAAA,CAAA,EAAA,OAAA,GAHnB,oBAGmB;;AAA6B,iBAAlD,WAAA,CAAkD,OAAA,CAAA,EAA7B,aAA6B,CAAA,EAAR,OAAQ,CAAA,UAAA,CAAA,OAAkB,KAAlB,CAAA,CAAA;AAAR,iBAIlC,OAAA,CAJkC,OAAA,CAAA,EAIjB,aAJiB,CAAA,EAII,OAJJ,CAIY,UAJZ,CAAA,OAI8B,KAJ9B,CAAA,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ async function applyPreset(options = {}) {
|
|
|
6
6
|
return eslint9(options);
|
|
7
7
|
}
|
|
8
8
|
async function eslint9(options = {}) {
|
|
9
|
-
const { type = "lib", ignores = [], test = true, unocss = false, vue = false, jsx = false, pnpm = false, stylistic = true, javascript = defaultJsConfig, typescript = defaultTsConfig, formatters = false } = options;
|
|
9
|
+
const { type = "lib", ignores = [], test = true, nextjs = false, react = false, unocss = false, vue = false, jsx = false, pnpm = false, stylistic = true, javascript = defaultJsConfig, typescript = defaultTsConfig, formatters = false } = options;
|
|
10
10
|
const _test = mergeWithDefaults(test, defaultTestConfig);
|
|
11
11
|
const _unocss = mergeWithDefaults(unocss, defaultUnocssConfig);
|
|
12
12
|
const _vue = mergeWithDefaults(vue, defaultVueConfig);
|
|
@@ -27,6 +27,8 @@ async function eslint9(options = {}) {
|
|
|
27
27
|
test: _test,
|
|
28
28
|
unocss: _unocss,
|
|
29
29
|
vue: _vue,
|
|
30
|
+
nextjs,
|
|
31
|
+
react,
|
|
30
32
|
jsx,
|
|
31
33
|
typescript: _typescript,
|
|
32
34
|
javascript: _javascript,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import type { OptionsTypeScriptParserOptions } from '@antfu/eslint-config'\nimport type { AntFuFormatterConfig, AntFuJsConfig, AntFuStrictTsConfig, AntFuStylisticConfig, AntFuTestConfig, AntFuTsConfig, AntFuUnocssConfig, AntFuVueConfig } from './types/index'\nimport { antfu } from '@antfu/eslint-config'\nimport { defaultFormatterConfig, defaultJsConfig, defaultStrictTsConfig, defaultStylisticConfig, defaultTestConfig, defaultTsConfig, defaultUnocssConfig, defaultVueConfig, mergeWithDefaults } from './defaults/index'\n\nexport interface ConfigOptions {\n type?: 'app' | 'lib'\n pnpm?: boolean\n test?: boolean | AntFuTestConfig\n ignores?: string[]\n jsx?: boolean\n vue?: boolean | AntFuVueConfig\n formatters?: boolean | AntFuFormatterConfig\n javascript?: AntFuJsConfig\n typescript?: boolean | AntFuStrictTsConfig | AntFuTsConfig\n unocss?: boolean | AntFuUnocssConfig\n stylistic?: boolean | AntFuStylisticConfig\n}\n\nexport async function applyPreset(options: ConfigOptions = {}): Promise<ReturnType<typeof antfu>> {\n return eslint9(options)\n}\n\nexport default async function eslint9(options: ConfigOptions = {}): Promise<ReturnType<typeof antfu>> {\n const {\n type = 'lib',\n ignores = [],\n test = true,\n unocss = false,\n vue = false,\n jsx = false,\n pnpm = false,\n stylistic = true,\n javascript = defaultJsConfig,\n typescript = defaultTsConfig,\n formatters = false,\n } = options\n\n const _test = mergeWithDefaults(test, defaultTestConfig)\n const _unocss = mergeWithDefaults(unocss, defaultUnocssConfig)\n const _vue = mergeWithDefaults(vue, defaultVueConfig)\n const _javascript = mergeWithDefaults(javascript, defaultJsConfig)\n const _stylistic = mergeWithDefaults(stylistic, defaultStylisticConfig)\n const _formatters = mergeWithDefaults(formatters, defaultFormatterConfig)\n let _typescript = typescript\n\n // 如果 type 为 'app',强制 pnpm 为 false\n let _pnpm = pnpm\n if (type === 'app') {\n _pnpm = false\n }\n\n // 严格 ts 模式\n if (\n _typescript !== null\n && typeof _typescript === 'object'\n && 'strictTypescriptEslint' in _typescript\n && _typescript.strictTypescriptEslint === true\n ) {\n _typescript = mergeWithDefaults(typescript, defaultStrictTsConfig)\n if (typeof _typescript === 'object' && 'tsconfigPath' in _typescript) {\n (_typescript as OptionsTypeScriptParserOptions).parserOptions = {\n projectService: true,\n }\n }\n }\n\n return antfu({\n type,\n ignores,\n pnpm: _pnpm,\n test: _test,\n unocss: _unocss,\n vue: _vue,\n jsx,\n typescript: _typescript,\n javascript: _javascript,\n stylistic: _stylistic,\n formatters: _formatters,\n })\n}\n"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import type { OptionsTypeScriptParserOptions } from '@antfu/eslint-config'\nimport type { AntFuFormatterConfig, AntFuJsConfig, AntFuStrictTsConfig, AntFuStylisticConfig, AntFuTestConfig, AntFuTsConfig, AntFuUnocssConfig, AntFuVueConfig } from './types/index'\nimport { antfu } from '@antfu/eslint-config'\nimport { defaultFormatterConfig, defaultJsConfig, defaultStrictTsConfig, defaultStylisticConfig, defaultTestConfig, defaultTsConfig, defaultUnocssConfig, defaultVueConfig, mergeWithDefaults } from './defaults/index'\n\nexport interface ConfigOptions {\n type?: 'app' | 'lib'\n pnpm?: boolean\n test?: boolean | AntFuTestConfig\n ignores?: string[]\n jsx?: boolean\n nextjs?: boolean\n react?: boolean\n vue?: boolean | AntFuVueConfig\n formatters?: boolean | AntFuFormatterConfig\n javascript?: AntFuJsConfig\n typescript?: boolean | AntFuStrictTsConfig | AntFuTsConfig\n unocss?: boolean | AntFuUnocssConfig\n stylistic?: boolean | AntFuStylisticConfig\n}\n\nexport async function applyPreset(options: ConfigOptions = {}): Promise<ReturnType<typeof antfu>> {\n return eslint9(options)\n}\n\nexport default async function eslint9(options: ConfigOptions = {}): Promise<ReturnType<typeof antfu>> {\n const {\n type = 'lib',\n ignores = [],\n test = true,\n nextjs = false,\n react = false,\n unocss = false,\n vue = false,\n jsx = false,\n pnpm = false,\n stylistic = true,\n javascript = defaultJsConfig,\n typescript = defaultTsConfig,\n formatters = false,\n } = options\n\n const _test = mergeWithDefaults(test, defaultTestConfig)\n const _unocss = mergeWithDefaults(unocss, defaultUnocssConfig)\n const _vue = mergeWithDefaults(vue, defaultVueConfig)\n const _javascript = mergeWithDefaults(javascript, defaultJsConfig)\n const _stylistic = mergeWithDefaults(stylistic, defaultStylisticConfig)\n const _formatters = mergeWithDefaults(formatters, defaultFormatterConfig)\n let _typescript = typescript\n\n // 如果 type 为 'app',强制 pnpm 为 false\n let _pnpm = pnpm\n if (type === 'app') {\n _pnpm = false\n }\n\n // 严格 ts 模式\n if (\n _typescript !== null\n && typeof _typescript === 'object'\n && 'strictTypescriptEslint' in _typescript\n && _typescript.strictTypescriptEslint === true\n ) {\n _typescript = mergeWithDefaults(typescript, defaultStrictTsConfig)\n if (typeof _typescript === 'object' && 'tsconfigPath' in _typescript) {\n (_typescript as OptionsTypeScriptParserOptions).parserOptions = {\n projectService: true,\n }\n }\n }\n\n return antfu({\n type,\n ignores,\n pnpm: _pnpm,\n test: _test,\n unocss: _unocss,\n vue: _vue,\n nextjs,\n react,\n jsx,\n typescript: _typescript,\n javascript: _javascript,\n stylistic: _stylistic,\n formatters: _formatters,\n })\n}\n"],"mappings":";;;;AAqBA,eAAsB,YAAY,UAAyB,EAAE,EAAqC;AAChG,QAAO,QAAQ,QAAQ;;AAGzB,eAA8B,QAAQ,UAAyB,EAAE,EAAqC;CACpG,MAAM,EACJ,OAAO,OACP,UAAU,EAAE,EACZ,OAAO,MACP,SAAS,OACT,QAAQ,OACR,SAAS,OACT,MAAM,OACN,MAAM,OACN,OAAO,OACP,YAAY,MACZ,aAAa,iBACb,aAAa,iBACb,aAAa,UACX;CAEJ,MAAM,QAAQ,kBAAkB,MAAM,kBAAkB;CACxD,MAAM,UAAU,kBAAkB,QAAQ,oBAAoB;CAC9D,MAAM,OAAO,kBAAkB,KAAK,iBAAiB;CACrD,MAAM,cAAc,kBAAkB,YAAY,gBAAgB;CAClE,MAAM,aAAa,kBAAkB,WAAW,uBAAuB;CACvE,MAAM,cAAc,kBAAkB,YAAY,uBAAuB;CACzE,IAAI,cAAc;CAGlB,IAAI,QAAQ;AACZ,KAAI,SAAS,MACX,SAAQ;AAIV,KACE,gBAAgB,QACb,OAAO,gBAAgB,YACvB,4BAA4B,eAC5B,YAAY,2BAA2B,MAC1C;AACA,gBAAc,kBAAkB,YAAY,sBAAsB;AAClE,MAAI,OAAO,gBAAgB,YAAY,kBAAkB,YACvD,CAAC,YAA+C,gBAAgB,EAC9D,gBAAgB,MACjB;;AAIL,QAAO,MAAM;EACX;EACA;EACA,MAAM;EACN,MAAM;EACN,QAAQ;EACR,KAAK;EACL;EACA;EACA;EACA,YAAY;EACZ,YAAY;EACZ,WAAW;EACX,YAAY;EACb,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/types/index.ts"],"sourcesContent":[],"mappings":";;;;;;AAKA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/types/index.ts"],"sourcesContent":[],"mappings":";;;;;;AAKA;AAAwD,KAA5C,WAAA,GAAc,WAA8B,CAAlB,UAAkB,CAAA,OAAA,OAAA,CAAA,CAAA,CAAA,CAAA,CAAA;;;;AAK5C,KAAA,aAAA,GAAgB,OAAQ,CAAA,WAAR,CAAA,YAAA,CAAA,EAAA,OAAA,GAAA,SAAA,CAAA;AAK5B;AAKA;AAKA;AAKY,KAfA,aAAA,GAAgB,OAehB,CAfwB,WAeO,CAAA,YAAR,CAAA,EAAA,OAAA,GAAA,SAAA,CAAA;AAKnC;AAKA;AAIA;KAxBY,cAAA,GAAiB,QAAQ;;;;KAKzB,iBAAA,GAAoB,QAAQ;;;;KAK5B,oBAAA,GAAuB,QAAQ;;;;KAK/B,oBAAA,GAAuB,QAAQ;;;;KAK/B,eAAA,GAAkB,QAAQ;;;;KAI1B,mBAAA,GAAsB"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truenine/eslint9-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.19",
|
|
5
5
|
"description": "ESLint 9 configuration package for Compose Client projects with TypeScript, Vue, and modern JavaScript support",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "TrueNine",
|
|
@@ -56,30 +56,33 @@
|
|
|
56
56
|
"registry": "https://registry.npmjs.org/"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
|
-
"@antfu/eslint-config": "^
|
|
60
|
-
"@eslint/js": "^9.
|
|
61
|
-
"@
|
|
59
|
+
"@antfu/eslint-config": "^6.2.0",
|
|
60
|
+
"@eslint/js": "^9.39.1",
|
|
61
|
+
"@next/eslint-plugin-next": "^16.0.3",
|
|
62
|
+
"@unocss/eslint-config": "^66.5.6",
|
|
62
63
|
"@vue/eslint-config-prettier": "^10.2.0",
|
|
63
64
|
"@vue/eslint-config-typescript": "^14.6.0",
|
|
64
|
-
"eslint": "^9.
|
|
65
|
+
"eslint": "^9.39.1",
|
|
65
66
|
"eslint-plugin-format": "^1.0.2",
|
|
66
67
|
"eslint-plugin-prettier": "^5.5.4",
|
|
67
|
-
"eslint-plugin-vue": "^10.5.
|
|
68
|
+
"eslint-plugin-vue": "^10.5.1",
|
|
68
69
|
"prettier": "^3.6.2",
|
|
69
|
-
"typescript-eslint": "^8.
|
|
70
|
+
"typescript-eslint": "^8.46.4"
|
|
70
71
|
},
|
|
71
72
|
"dependencies": {
|
|
72
|
-
"@antfu/eslint-config": "^
|
|
73
|
-
"@eslint/js": "^9.
|
|
74
|
-
"@
|
|
73
|
+
"@antfu/eslint-config": "^6.2.0",
|
|
74
|
+
"@eslint/js": "^9.39.1",
|
|
75
|
+
"@next/eslint-plugin-next": "^16.0.3",
|
|
76
|
+
"@unocss/eslint-config": "^66.5.6",
|
|
75
77
|
"@vue/eslint-config-prettier": "^10.2.0",
|
|
76
78
|
"@vue/eslint-config-typescript": "^14.6.0",
|
|
77
|
-
"eslint": "^9.
|
|
79
|
+
"eslint": "^9.39.1",
|
|
78
80
|
"eslint-plugin-format": "^1.0.2",
|
|
79
81
|
"eslint-plugin-prettier": "^5.5.4",
|
|
80
|
-
"eslint-plugin-vue": "^10.5.
|
|
82
|
+
"eslint-plugin-vue": "^10.5.1",
|
|
81
83
|
"prettier": "^3.6.2",
|
|
82
|
-
"typescript
|
|
84
|
+
"typescript": "^5.9.3",
|
|
85
|
+
"typescript-eslint": "^8.46.4"
|
|
83
86
|
},
|
|
84
87
|
"scripts": {
|
|
85
88
|
"build": "tsdown",
|