@kikiutils/eslint-config 3.0.0 → 4.0.0
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/README.md +1 -1
- package/dist/index.d.ts +7 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +23 -13
- package/src/index.ts +3 -9
package/README.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import * as _antfu_eslint_config0 from "@antfu/eslint-config";
|
|
2
|
+
import { TypedFlatConfigItem, antfu } from "@antfu/eslint-config";
|
|
3
|
+
import * as eslint_flat_config_utils0 from "eslint-flat-config-utils";
|
|
3
4
|
|
|
4
5
|
//#region src/index.d.ts
|
|
5
|
-
declare function createConfig(environment?: 'bun' | 'node', options?: Parameters<typeof antfu>[0]): FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
|
|
6
|
-
declare const bun: FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
|
|
7
|
-
declare const node: FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
|
|
8
|
-
declare const vue: FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
|
|
6
|
+
declare function createConfig(environment?: 'bun' | 'node', options?: Parameters<typeof antfu>[0]): eslint_flat_config_utils0.FlatConfigComposer<TypedFlatConfigItem, _antfu_eslint_config0.ConfigNames>;
|
|
7
|
+
declare const bun: eslint_flat_config_utils0.FlatConfigComposer<TypedFlatConfigItem, _antfu_eslint_config0.ConfigNames>;
|
|
8
|
+
declare const node: eslint_flat_config_utils0.FlatConfigComposer<TypedFlatConfigItem, _antfu_eslint_config0.ConfigNames>;
|
|
9
|
+
declare const vue: eslint_flat_config_utils0.FlatConfigComposer<TypedFlatConfigItem, _antfu_eslint_config0.ConfigNames>;
|
|
9
10
|
//#endregion
|
|
10
11
|
export { bun, createConfig, node, vue };
|
|
11
12
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;iBAkBgB,YAAA,yCAA6D,kBAAkB,YAAS,yBAAA,CAAA,mBAAA,qBAAA,qBAAA,CAAA,WAAA;cAyZ3F,KAAG,yBAAA,CAAA,mBAAA,qBAAA,qBAAA,CAAA,WAAA;cACH,MAAI,yBAAA,CAAA,mBAAA,qBAAA,qBAAA,CAAA,WAAA;AA1ZD,cA2ZH,GA3Ze,EA2ZZ,yBAAA,CAAA,kBA3ZY,CA2ZZ,mBA3ZY,EA2ZZ,qBAAA,CAAA,WAAA,CA3ZY"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["userConfigs: Parameters<typeof antfu>[1]"],"sources":["../src/index.ts"],"sourcesContent":["import { antfu } from '@antfu/eslint-config';\nimport type {\n ConfigNames,\n TypedFlatConfigItem,\n} from '@antfu/eslint-config';\n// @ts-expect-error No declare file.\nimport kikiutilsTailwindcss from '@kikiutils/eslint-plugin-tailwindcss';\n// @ts-expect-error Ignore this error.\nimport kikiutilsEslintPluginVue from '@kikiutils/eslint-plugin-vue';\nimport type { FlatConfigComposer } from 'eslint-flat-config-utils';\nimport format from 'eslint-plugin-format';\n// @ts-expect-error No declare file.\nimport promise from 'eslint-plugin-promise';\n// @ts-expect-error No declare file.\nimport tailwindcss from 'eslint-plugin-tailwindcss';\n\nconst basePerfectionistSortOptions = {\n ignoreCase: false,\n type: 'natural',\n} as const;\n\nexport function createConfig(\n environment: 'bun' | 'node' = 'node',\n options?: Parameters<typeof antfu>[0],\n): FlatConfigComposer<TypedFlatConfigItem, ConfigNames> {\n const userConfigs: Parameters<typeof antfu>[1] = [\n {\n files: ['**/*.{cjs,js,mjs,ts,tsx,vue}'],\n plugins: { promise },\n rules: {\n 'antfu/consistent-list-newline': [\n 'error',\n {\n ArrayExpression: false,\n ArrayPattern: false,\n },\n ],\n 'antfu/curly': 'off',\n 'antfu/if-newline': 'off',\n 'antfu/no-top-level-await': 'off',\n 'curly': [\n 'error',\n 'multi-line',\n ],\n 'max-classes-per-file': [\n 'error',\n 1,\n ],\n 'no-promise-executor-return': [\n 'error',\n { allowVoid: true },\n ],\n 'node/prefer-global/process': [\n 'error',\n 'always',\n ],\n 'perfectionist/sort-array-includes': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-enums': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-heritage-clauses': [\n 'error',\n {\n ignoreCase: false,\n type: 'natural',\n },\n ],\n 'perfectionist/sort-imports': [\n 'error',\n {\n environment,\n groups: [\n 'side-effect',\n 'side-effect-style',\n 'style',\n [\n 'builtin',\n 'builtin-type',\n ],\n [\n 'external',\n 'external-type',\n ],\n [\n 'internal',\n 'internal-type',\n ],\n [\n 'parent',\n 'parent-type',\n ],\n [\n 'sibling',\n 'sibling-type',\n ],\n [\n 'index',\n 'index-type',\n ],\n 'object',\n 'unknown',\n ],\n ignoreCase: false,\n internalPattern: [\n '^#.*',\n '^@/.*',\n '^~/.*',\n ],\n type: 'natural',\n },\n ],\n 'perfectionist/sort-interfaces': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-intersection-types': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-maps': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-modules': [\n 'error',\n {\n ...basePerfectionistSortOptions,\n groups: [\n 'declare-type',\n [\n 'export-type',\n 'type',\n ],\n 'declare-interface',\n [\n 'export-interface',\n 'interface',\n ],\n 'declare-enum',\n [\n 'enum',\n 'export-enum',\n ],\n 'declare-class',\n [\n 'class',\n 'export-class',\n ],\n 'declare-function',\n [\n 'export-function',\n 'function',\n ],\n ],\n },\n ],\n 'perfectionist/sort-object-types': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-objects': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-sets': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-switch-case': [\n 'error',\n {\n ignoreCase: false,\n type: 'natural',\n },\n ],\n 'perfectionist/sort-union-types': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-variable-declarations': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'promise/no-multiple-resolved': 'error',\n 'promise/no-return-in-finally': 'error',\n 'promise/no-return-wrap': 'error',\n 'require-await': 'error',\n 'style/array-bracket-newline': [\n 'error',\n { multiline: true },\n ],\n 'style/array-element-newline': [\n 'error',\n {\n ArrayExpression: {\n consistent: true,\n minItems: 2,\n },\n ArrayPattern: { minItems: 3 },\n },\n ],\n 'style/arrow-parens': [\n 'error',\n 'always',\n ],\n 'style/brace-style': [\n 'error',\n '1tbs',\n { allowSingleLine: false },\n ],\n 'style/function-call-spacing': [\n 'error',\n 'never',\n ],\n 'style/indent': [\n 'error',\n 4,\n ],\n 'style/max-len': [\n 'warn',\n {\n code: 120,\n comments: 120,\n },\n ],\n 'style/member-delimiter-style': [\n 'error',\n {\n multiline: {\n delimiter: 'semi',\n requireLast: true,\n },\n },\n ],\n 'style/no-extra-parens': [\n 'error',\n 'all',\n { nestedBinaryExpressions: false },\n ],\n 'style/no-extra-semi': 'error',\n 'style/object-curly-newline': [\n 'error',\n {\n ExportDeclaration: {\n minProperties: 2,\n multiline: true,\n },\n ImportDeclaration: {\n minProperties: 2,\n multiline: true,\n },\n ObjectExpression: {\n minProperties: 2,\n multiline: true,\n },\n ObjectPattern: {\n minProperties: 3,\n multiline: true,\n },\n },\n ],\n 'style/operator-linebreak': [\n 'error',\n 'before',\n { overrides: { '=': 'after' } },\n ],\n 'style/padding-line-between-statements': [\n 'error',\n {\n blankLine: 'always',\n next: [\n 'class',\n 'enum',\n 'function',\n ],\n prev: '*',\n },\n {\n blankLine: 'always',\n next: '*',\n prev: [\n 'class',\n 'function',\n ],\n },\n ],\n 'style/semi': [\n 'error',\n 'always',\n ],\n 'ts/consistent-generic-constructors': [\n 'error',\n 'constructor',\n ],\n 'ts/no-redeclare': 'off',\n },\n },\n {\n files: ['**/*.vue'],\n plugins: {\n '@kikiutils/tailwindcss': kikiutilsTailwindcss,\n '@kikiutils/vue': kikiutilsEslintPluginVue,\n tailwindcss,\n },\n rules: {\n '@kikiutils/tailwindcss/classnames-order': 'error',\n '@kikiutils/vue/attributes-order': [\n 'error',\n { alphabetical: true },\n ],\n '@kikiutils/vue/no-extra-space-in-class': 'error',\n 'style/max-len': 'off',\n 'tailwindcss/classnames-order': 'off',\n 'tailwindcss/enforces-negative-arbitrary-values': 'error',\n 'tailwindcss/enforces-shorthand': 'error',\n 'tailwindcss/no-unnecessary-arbitrary-value': 'error',\n 'vue/attribute-hyphenation': 'error',\n 'vue/attributes-order': 'off',\n 'vue/block-order': [\n 'error',\n {\n order: [\n 'template',\n 'script',\n 'style',\n ],\n },\n ],\n 'vue/component-api-style': 'error',\n 'vue/define-emits-declaration': 'error',\n 'vue/define-props-declaration': 'error',\n 'vue/enforce-style-attribute': 'error',\n 'vue/html-closing-bracket-newline': 'error',\n 'vue/html-closing-bracket-spacing': 'error',\n 'vue/html-indent': [\n 'error',\n 4,\n ],\n 'vue/max-attributes-per-line': [\n 'error',\n {\n multiline: 1,\n singleline: 1,\n },\n ],\n 'vue/max-len': [\n 'warn',\n {\n code: 120,\n comments: 120,\n template: 120,\n },\n ],\n 'vue/no-dupe-keys': 'error',\n 'vue/no-lone-template': 'error',\n 'vue/no-multi-spaces': 'error',\n 'vue/no-multiple-objects-in-class': 'error',\n 'vue/no-root-v-if': 'error',\n 'vue/no-template-target-blank': 'error',\n 'vue/no-v-html': 'error',\n 'vue/prefer-define-options': 'error',\n 'vue/prefer-separate-static-class': 'error',\n 'vue/require-explicit-emits': 'error',\n 'vue/require-typed-ref': 'error',\n },\n },\n {\n files: ['**/.vscode/*.json'],\n rules: {\n 'jsonc/sort-array-values': [\n 'error',\n {\n order: {\n natural: true,\n type: 'asc',\n },\n pathPattern: '^.*$',\n },\n ],\n 'jsonc/sort-keys': [\n 'error',\n 'asc',\n {\n caseSensitive: true,\n natural: true,\n },\n ],\n },\n },\n ];\n\n if (options?.formatters && (typeof options.formatters === 'boolean' || options.formatters.css)) {\n userConfigs.splice(\n 1,\n 0,\n createPrettierCssConfig('css'),\n createPrettierCssConfig('sass'),\n createPrettierCssConfig('scss'),\n );\n }\n\n return antfu(\n {\n typescript: true,\n ...options,\n },\n ...userConfigs,\n );\n}\n\nfunction createPrettierCssConfig(parser: 'css' | 'sass' | 'scss'): TypedFlatConfigItem {\n return {\n files: [`**/*.${parser}`],\n languageOptions: { parser: format.parserPlain },\n plugins: { format },\n rules: {\n 'format/prettier': [\n 'error',\n {\n parser,\n printWidth: 120,\n singleQuote: true,\n tabWidth: 4,\n },\n ],\n },\n };\n}\n\nexport const bun = createConfig('bun');\nexport const node = createConfig('node');\nexport const vue = createConfig(\n 'node',\n {\n formatters: { css: true },\n vue: true,\n },\n);\n"],"mappings":";;;;;;;;AAgBA,MAAM,+BAA+B;CACjC,YAAY;CACZ,MAAM;CACT;AAED,SAAgB,aACZ,cAA8B,QAC9B,SACoD;CACpD,MAAMA,cAA2C;EAC7C;GACI,OAAO,CAAC,+BAA+B;GACvC,SAAS,EAAE,SAAS;GACpB,OAAO;IACH,iCAAiC,CAC7B,SACA;KACI,iBAAiB;KACjB,cAAc;KACjB,CACJ;IACD,eAAe;IACf,oBAAoB;IACpB,4BAA4B;IAC5B,SAAS,CACL,SACA,aACH;IACD,wBAAwB,CACpB,SACA,EACH;IACD,8BAA8B,CAC1B,SACA,EAAE,WAAW,MAAM,CACtB;IACD,8BAA8B,CAC1B,SACA,SACH;IACD,qCAAqC,CACjC,SACA,6BACH;IACD,4BAA4B,CACxB,SACA,6BACH;IACD,uCAAuC,CACnC,SACA;KACI,YAAY;KACZ,MAAM;KACT,CACJ;IACD,8BAA8B,CAC1B,SACA;KACI;KACA,QAAQ;MACJ;MACA;MACA;MACA,CACI,WACA,eACH;MACD,CACI,YACA,gBACH;MACD,CACI,YACA,gBACH;MACD,CACI,UACA,cACH;MACD,CACI,WACA,eACH;MACD,CACI,SACA,aACH;MACD;MACA;MACH;KACD,YAAY;KACZ,iBAAiB;MACb;MACA;MACA;MACH;KACD,MAAM;KACT,CACJ;IACD,iCAAiC,CAC7B,SACA,6BACH;IACD,yCAAyC,CACrC,SACA,6BACH;IACD,2BAA2B,CACvB,SACA,6BACH;IACD,8BAA8B,CAC1B,SACA;KACI,GAAG;KACH,QAAQ;MACJ;MACA,CACI,eACA,OACH;MACD;MACA,CACI,oBACA,YACH;MACD;MACA,CACI,QACA,cACH;MACD;MACA,CACI,SACA,eACH;MACD;MACA,CACI,mBACA,WACH;MACJ;KACJ,CACJ;IACD,mCAAmC,CAC/B,SACA,6BACH;IACD,8BAA8B,CAC1B,SACA,6BACH;IACD,2BAA2B,CACvB,SACA,6BACH;IACD,kCAAkC,CAC9B,SACA;KACI,YAAY;KACZ,MAAM;KACT,CACJ;IACD,kCAAkC,CAC9B,SACA,6BACH;IACD,4CAA4C,CACxC,SACA,6BACH;IACD,gCAAgC;IAChC,gCAAgC;IAChC,0BAA0B;IAC1B,iBAAiB;IACjB,+BAA+B,CAC3B,SACA,EAAE,WAAW,MAAM,CACtB;IACD,+BAA+B,CAC3B,SACA;KACI,iBAAiB;MACb,YAAY;MACZ,UAAU;MACb;KACD,cAAc,EAAE,UAAU,GAAG;KAChC,CACJ;IACD,sBAAsB,CAClB,SACA,SACH;IACD,qBAAqB;KACjB;KACA;KACA,EAAE,iBAAiB,OAAO;KAC7B;IACD,+BAA+B,CAC3B,SACA,QACH;IACD,gBAAgB,CACZ,SACA,EACH;IACD,iBAAiB,CACb,QACA;KACI,MAAM;KACN,UAAU;KACb,CACJ;IACD,gCAAgC,CAC5B,SACA,EACI,WAAW;KACP,WAAW;KACX,aAAa;KAChB,EACJ,CACJ;IACD,yBAAyB;KACrB;KACA;KACA,EAAE,yBAAyB,OAAO;KACrC;IACD,uBAAuB;IACvB,8BAA8B,CAC1B,SACA;KACI,mBAAmB;MACf,eAAe;MACf,WAAW;MACd;KACD,mBAAmB;MACf,eAAe;MACf,WAAW;MACd;KACD,kBAAkB;MACd,eAAe;MACf,WAAW;MACd;KACD,eAAe;MACX,eAAe;MACf,WAAW;MACd;KACJ,CACJ;IACD,4BAA4B;KACxB;KACA;KACA,EAAE,WAAW,EAAE,KAAK,SAAS,EAAE;KAClC;IACD,yCAAyC;KACrC;KACA;MACI,WAAW;MACX,MAAM;OACF;OACA;OACA;OACH;MACD,MAAM;MACT;KACD;MACI,WAAW;MACX,MAAM;MACN,MAAM,CACF,SACA,WACH;MACJ;KACJ;IACD,cAAc,CACV,SACA,SACH;IACD,sCAAsC,CAClC,SACA,cACH;IACD,mBAAmB;IACtB;GACJ;EACD;GACI,OAAO,CAAC,WAAW;GACnB,SAAS;IACL,0BAA0B;IAC1B,kBAAkB;IAClB;IACH;GACD,OAAO;IACH,2CAA2C;IAC3C,mCAAmC,CAC/B,SACA,EAAE,cAAc,MAAM,CACzB;IACD,0CAA0C;IAC1C,iBAAiB;IACjB,gCAAgC;IAChC,kDAAkD;IAClD,kCAAkC;IAClC,8CAA8C;IAC9C,6BAA6B;IAC7B,wBAAwB;IACxB,mBAAmB,CACf,SACA,EACI,OAAO;KACH;KACA;KACA;KACH,EACJ,CACJ;IACD,2BAA2B;IAC3B,gCAAgC;IAChC,gCAAgC;IAChC,+BAA+B;IAC/B,oCAAoC;IACpC,oCAAoC;IACpC,mBAAmB,CACf,SACA,EACH;IACD,+BAA+B,CAC3B,SACA;KACI,WAAW;KACX,YAAY;KACf,CACJ;IACD,eAAe,CACX,QACA;KACI,MAAM;KACN,UAAU;KACV,UAAU;KACb,CACJ;IACD,oBAAoB;IACpB,wBAAwB;IACxB,uBAAuB;IACvB,oCAAoC;IACpC,oBAAoB;IACpB,gCAAgC;IAChC,iBAAiB;IACjB,6BAA6B;IAC7B,oCAAoC;IACpC,8BAA8B;IAC9B,yBAAyB;IAC5B;GACJ;EACD;GACI,OAAO,CAAC,oBAAoB;GAC5B,OAAO;IACH,2BAA2B,CACvB,SACA;KACI,OAAO;MACH,SAAS;MACT,MAAM;MACT;KACD,aAAa;KAChB,CACJ;IACD,mBAAmB;KACf;KACA;KACA;MACI,eAAe;MACf,SAAS;MACZ;KACJ;IACJ;GACJ;EACJ;AAED,KAAI,SAAS,eAAe,OAAO,QAAQ,eAAe,aAAa,QAAQ,WAAW,KACtF,aAAY,OACR,GACA,GACA,wBAAwB,MAAM,EAC9B,wBAAwB,OAAO,EAC/B,wBAAwB,OAAO,CAClC;AAGL,QAAO,MACH;EACI,YAAY;EACZ,GAAG;EACN,EACD,GAAG,YACN;;AAGL,SAAS,wBAAwB,QAAsD;AACnF,QAAO;EACH,OAAO,CAAC,QAAQ,SAAS;EACzB,iBAAiB,EAAE,QAAQ,OAAO,aAAa;EAC/C,SAAS,EAAE,QAAQ;EACnB,OAAO,EACH,mBAAmB,CACf,SACA;GACI;GACA,YAAY;GACZ,aAAa;GACb,UAAU;GACb,CACJ,EACJ;EACJ;;AAGL,MAAa,MAAM,aAAa,MAAM;AACtC,MAAa,OAAO,aAAa,OAAO;AACxC,MAAa,MAAM,aACf,QACA;CACI,YAAY,EAAE,KAAK,MAAM;CACzB,KAAK;CACR,CACJ"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["userConfigs: Parameters<typeof antfu>[1]"],"sources":["../src/index.ts"],"sourcesContent":["import { antfu } from '@antfu/eslint-config';\nimport type { TypedFlatConfigItem } from '@antfu/eslint-config';\n// @ts-expect-error No declare file.\nimport kikiutilsTailwindcss from '@kikiutils/eslint-plugin-tailwindcss';\n// @ts-expect-error Ignore this error.\nimport kikiutilsEslintPluginVue from '@kikiutils/eslint-plugin-vue';\n// @ts-expect-error Ignore this error.\nimport format from 'eslint-plugin-format';\n// @ts-expect-error No declare file.\nimport promise from 'eslint-plugin-promise';\n// @ts-expect-error No declare file.\nimport tailwindcss from 'eslint-plugin-tailwindcss';\n\nconst basePerfectionistSortOptions = {\n ignoreCase: false,\n type: 'natural',\n} as const;\n\nexport function createConfig(environment: 'bun' | 'node' = 'node', options?: Parameters<typeof antfu>[0]) {\n const userConfigs: Parameters<typeof antfu>[1] = [\n {\n files: ['**/*.{cjs,js,mjs,ts,tsx,vue}'],\n plugins: { promise },\n rules: {\n 'antfu/consistent-list-newline': [\n 'error',\n {\n ArrayExpression: false,\n ArrayPattern: false,\n },\n ],\n 'antfu/curly': 'off',\n 'antfu/if-newline': 'off',\n 'antfu/no-top-level-await': 'off',\n 'curly': [\n 'error',\n 'multi-line',\n ],\n 'max-classes-per-file': [\n 'error',\n 1,\n ],\n 'no-promise-executor-return': [\n 'error',\n { allowVoid: true },\n ],\n 'node/prefer-global/process': [\n 'error',\n 'always',\n ],\n 'perfectionist/sort-array-includes': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-enums': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-heritage-clauses': [\n 'error',\n {\n ignoreCase: false,\n type: 'natural',\n },\n ],\n 'perfectionist/sort-imports': [\n 'error',\n {\n environment,\n groups: [\n 'side-effect',\n 'side-effect-style',\n 'style',\n [\n 'builtin',\n 'builtin-type',\n ],\n [\n 'external',\n 'external-type',\n ],\n [\n 'internal',\n 'internal-type',\n ],\n [\n 'parent',\n 'parent-type',\n ],\n [\n 'sibling',\n 'sibling-type',\n ],\n [\n 'index',\n 'index-type',\n ],\n 'object',\n 'unknown',\n ],\n ignoreCase: false,\n internalPattern: [\n '^#.*',\n '^@/.*',\n '^~/.*',\n ],\n type: 'natural',\n },\n ],\n 'perfectionist/sort-interfaces': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-intersection-types': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-maps': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-modules': [\n 'error',\n {\n ...basePerfectionistSortOptions,\n groups: [\n 'declare-type',\n [\n 'export-type',\n 'type',\n ],\n 'declare-interface',\n [\n 'export-interface',\n 'interface',\n ],\n 'declare-enum',\n [\n 'enum',\n 'export-enum',\n ],\n 'declare-class',\n [\n 'class',\n 'export-class',\n ],\n 'declare-function',\n [\n 'export-function',\n 'function',\n ],\n ],\n },\n ],\n 'perfectionist/sort-object-types': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-objects': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-sets': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-switch-case': [\n 'error',\n {\n ignoreCase: false,\n type: 'natural',\n },\n ],\n 'perfectionist/sort-union-types': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-variable-declarations': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'promise/no-multiple-resolved': 'error',\n 'promise/no-return-in-finally': 'error',\n 'promise/no-return-wrap': 'error',\n 'require-await': 'error',\n 'style/array-bracket-newline': [\n 'error',\n { multiline: true },\n ],\n 'style/array-element-newline': [\n 'error',\n {\n ArrayExpression: {\n consistent: true,\n minItems: 2,\n },\n ArrayPattern: { minItems: 3 },\n },\n ],\n 'style/arrow-parens': [\n 'error',\n 'always',\n ],\n 'style/brace-style': [\n 'error',\n '1tbs',\n { allowSingleLine: false },\n ],\n 'style/function-call-spacing': [\n 'error',\n 'never',\n ],\n 'style/indent': [\n 'error',\n 4,\n ],\n 'style/max-len': [\n 'warn',\n {\n code: 120,\n comments: 120,\n },\n ],\n 'style/member-delimiter-style': [\n 'error',\n {\n multiline: {\n delimiter: 'semi',\n requireLast: true,\n },\n },\n ],\n 'style/no-extra-parens': [\n 'error',\n 'all',\n { nestedBinaryExpressions: false },\n ],\n 'style/no-extra-semi': 'error',\n 'style/object-curly-newline': [\n 'error',\n {\n ExportDeclaration: {\n minProperties: 2,\n multiline: true,\n },\n ImportDeclaration: {\n minProperties: 2,\n multiline: true,\n },\n ObjectExpression: {\n minProperties: 2,\n multiline: true,\n },\n ObjectPattern: {\n minProperties: 3,\n multiline: true,\n },\n },\n ],\n 'style/operator-linebreak': [\n 'error',\n 'before',\n { overrides: { '=': 'after' } },\n ],\n 'style/padding-line-between-statements': [\n 'error',\n {\n blankLine: 'always',\n next: [\n 'class',\n 'enum',\n 'function',\n ],\n prev: '*',\n },\n {\n blankLine: 'always',\n next: '*',\n prev: [\n 'class',\n 'function',\n ],\n },\n ],\n 'style/semi': [\n 'error',\n 'always',\n ],\n 'ts/consistent-generic-constructors': [\n 'error',\n 'constructor',\n ],\n 'ts/no-redeclare': 'off',\n },\n },\n {\n files: ['**/*.vue'],\n plugins: {\n '@kikiutils/tailwindcss': kikiutilsTailwindcss,\n '@kikiutils/vue': kikiutilsEslintPluginVue,\n tailwindcss,\n },\n rules: {\n '@kikiutils/tailwindcss/classnames-order': 'error',\n '@kikiutils/vue/attributes-order': [\n 'error',\n { alphabetical: true },\n ],\n '@kikiutils/vue/no-extra-space-in-class': 'error',\n 'style/max-len': 'off',\n 'tailwindcss/classnames-order': 'off',\n 'tailwindcss/enforces-negative-arbitrary-values': 'error',\n 'tailwindcss/enforces-shorthand': 'error',\n 'tailwindcss/no-unnecessary-arbitrary-value': 'error',\n 'vue/attribute-hyphenation': 'error',\n 'vue/attributes-order': 'off',\n 'vue/block-order': [\n 'error',\n {\n order: [\n 'template',\n 'script',\n 'style',\n ],\n },\n ],\n 'vue/component-api-style': 'error',\n 'vue/define-emits-declaration': 'error',\n 'vue/define-props-declaration': 'error',\n 'vue/enforce-style-attribute': 'error',\n 'vue/html-closing-bracket-newline': 'error',\n 'vue/html-closing-bracket-spacing': 'error',\n 'vue/html-indent': [\n 'error',\n 4,\n ],\n 'vue/max-attributes-per-line': [\n 'error',\n {\n multiline: 1,\n singleline: 1,\n },\n ],\n 'vue/max-len': [\n 'warn',\n {\n code: 120,\n comments: 120,\n template: 120,\n },\n ],\n 'vue/no-dupe-keys': 'error',\n 'vue/no-lone-template': 'error',\n 'vue/no-multi-spaces': 'error',\n 'vue/no-multiple-objects-in-class': 'error',\n 'vue/no-root-v-if': 'error',\n 'vue/no-template-target-blank': 'error',\n 'vue/no-v-html': 'error',\n 'vue/prefer-define-options': 'error',\n 'vue/prefer-separate-static-class': 'error',\n 'vue/require-explicit-emits': 'error',\n 'vue/require-typed-ref': 'error',\n },\n },\n {\n files: ['**/.vscode/*.json'],\n rules: {\n 'jsonc/sort-array-values': [\n 'error',\n {\n order: {\n natural: true,\n type: 'asc',\n },\n pathPattern: '^.*$',\n },\n ],\n 'jsonc/sort-keys': [\n 'error',\n 'asc',\n {\n caseSensitive: true,\n natural: true,\n },\n ],\n },\n },\n ];\n\n if (options?.formatters && (typeof options.formatters === 'boolean' || options.formatters.css)) {\n userConfigs.splice(\n 1,\n 0,\n createPrettierCssConfig('css'),\n createPrettierCssConfig('sass'),\n createPrettierCssConfig('scss'),\n );\n }\n\n return antfu(\n {\n typescript: true,\n ...options,\n },\n ...userConfigs,\n );\n}\n\nfunction createPrettierCssConfig(parser: 'css' | 'sass' | 'scss'): TypedFlatConfigItem {\n return {\n files: [`**/*.${parser}`],\n languageOptions: { parser: format.parserPlain },\n plugins: { format },\n rules: {\n 'format/prettier': [\n 'error',\n {\n parser,\n printWidth: 120,\n singleQuote: true,\n tabWidth: 4,\n },\n ],\n },\n };\n}\n\nexport const bun = createConfig('bun');\nexport const node = createConfig('node');\nexport const vue = createConfig(\n 'node',\n {\n formatters: { css: true },\n vue: true,\n },\n);\n"],"mappings":";;;;;;;;AAaA,MAAM,+BAA+B;CACjC,YAAY;CACZ,MAAM;CACT;AAED,SAAgB,aAAa,cAA8B,QAAQ,SAAuC;CACtG,MAAMA,cAA2C;EAC7C;GACI,OAAO,CAAC,+BAA+B;GACvC,SAAS,EAAE,SAAS;GACpB,OAAO;IACH,iCAAiC,CAC7B,SACA;KACI,iBAAiB;KACjB,cAAc;KACjB,CACJ;IACD,eAAe;IACf,oBAAoB;IACpB,4BAA4B;IAC5B,SAAS,CACL,SACA,aACH;IACD,wBAAwB,CACpB,SACA,EACH;IACD,8BAA8B,CAC1B,SACA,EAAE,WAAW,MAAM,CACtB;IACD,8BAA8B,CAC1B,SACA,SACH;IACD,qCAAqC,CACjC,SACA,6BACH;IACD,4BAA4B,CACxB,SACA,6BACH;IACD,uCAAuC,CACnC,SACA;KACI,YAAY;KACZ,MAAM;KACT,CACJ;IACD,8BAA8B,CAC1B,SACA;KACI;KACA,QAAQ;MACJ;MACA;MACA;MACA,CACI,WACA,eACH;MACD,CACI,YACA,gBACH;MACD,CACI,YACA,gBACH;MACD,CACI,UACA,cACH;MACD,CACI,WACA,eACH;MACD,CACI,SACA,aACH;MACD;MACA;MACH;KACD,YAAY;KACZ,iBAAiB;MACb;MACA;MACA;MACH;KACD,MAAM;KACT,CACJ;IACD,iCAAiC,CAC7B,SACA,6BACH;IACD,yCAAyC,CACrC,SACA,6BACH;IACD,2BAA2B,CACvB,SACA,6BACH;IACD,8BAA8B,CAC1B,SACA;KACI,GAAG;KACH,QAAQ;MACJ;MACA,CACI,eACA,OACH;MACD;MACA,CACI,oBACA,YACH;MACD;MACA,CACI,QACA,cACH;MACD;MACA,CACI,SACA,eACH;MACD;MACA,CACI,mBACA,WACH;MACJ;KACJ,CACJ;IACD,mCAAmC,CAC/B,SACA,6BACH;IACD,8BAA8B,CAC1B,SACA,6BACH;IACD,2BAA2B,CACvB,SACA,6BACH;IACD,kCAAkC,CAC9B,SACA;KACI,YAAY;KACZ,MAAM;KACT,CACJ;IACD,kCAAkC,CAC9B,SACA,6BACH;IACD,4CAA4C,CACxC,SACA,6BACH;IACD,gCAAgC;IAChC,gCAAgC;IAChC,0BAA0B;IAC1B,iBAAiB;IACjB,+BAA+B,CAC3B,SACA,EAAE,WAAW,MAAM,CACtB;IACD,+BAA+B,CAC3B,SACA;KACI,iBAAiB;MACb,YAAY;MACZ,UAAU;MACb;KACD,cAAc,EAAE,UAAU,GAAG;KAChC,CACJ;IACD,sBAAsB,CAClB,SACA,SACH;IACD,qBAAqB;KACjB;KACA;KACA,EAAE,iBAAiB,OAAO;KAC7B;IACD,+BAA+B,CAC3B,SACA,QACH;IACD,gBAAgB,CACZ,SACA,EACH;IACD,iBAAiB,CACb,QACA;KACI,MAAM;KACN,UAAU;KACb,CACJ;IACD,gCAAgC,CAC5B,SACA,EACI,WAAW;KACP,WAAW;KACX,aAAa;KAChB,EACJ,CACJ;IACD,yBAAyB;KACrB;KACA;KACA,EAAE,yBAAyB,OAAO;KACrC;IACD,uBAAuB;IACvB,8BAA8B,CAC1B,SACA;KACI,mBAAmB;MACf,eAAe;MACf,WAAW;MACd;KACD,mBAAmB;MACf,eAAe;MACf,WAAW;MACd;KACD,kBAAkB;MACd,eAAe;MACf,WAAW;MACd;KACD,eAAe;MACX,eAAe;MACf,WAAW;MACd;KACJ,CACJ;IACD,4BAA4B;KACxB;KACA;KACA,EAAE,WAAW,EAAE,KAAK,SAAS,EAAE;KAClC;IACD,yCAAyC;KACrC;KACA;MACI,WAAW;MACX,MAAM;OACF;OACA;OACA;OACH;MACD,MAAM;MACT;KACD;MACI,WAAW;MACX,MAAM;MACN,MAAM,CACF,SACA,WACH;MACJ;KACJ;IACD,cAAc,CACV,SACA,SACH;IACD,sCAAsC,CAClC,SACA,cACH;IACD,mBAAmB;IACtB;GACJ;EACD;GACI,OAAO,CAAC,WAAW;GACnB,SAAS;IACL,0BAA0B;IAC1B,kBAAkB;IAClB;IACH;GACD,OAAO;IACH,2CAA2C;IAC3C,mCAAmC,CAC/B,SACA,EAAE,cAAc,MAAM,CACzB;IACD,0CAA0C;IAC1C,iBAAiB;IACjB,gCAAgC;IAChC,kDAAkD;IAClD,kCAAkC;IAClC,8CAA8C;IAC9C,6BAA6B;IAC7B,wBAAwB;IACxB,mBAAmB,CACf,SACA,EACI,OAAO;KACH;KACA;KACA;KACH,EACJ,CACJ;IACD,2BAA2B;IAC3B,gCAAgC;IAChC,gCAAgC;IAChC,+BAA+B;IAC/B,oCAAoC;IACpC,oCAAoC;IACpC,mBAAmB,CACf,SACA,EACH;IACD,+BAA+B,CAC3B,SACA;KACI,WAAW;KACX,YAAY;KACf,CACJ;IACD,eAAe,CACX,QACA;KACI,MAAM;KACN,UAAU;KACV,UAAU;KACb,CACJ;IACD,oBAAoB;IACpB,wBAAwB;IACxB,uBAAuB;IACvB,oCAAoC;IACpC,oBAAoB;IACpB,gCAAgC;IAChC,iBAAiB;IACjB,6BAA6B;IAC7B,oCAAoC;IACpC,8BAA8B;IAC9B,yBAAyB;IAC5B;GACJ;EACD;GACI,OAAO,CAAC,oBAAoB;GAC5B,OAAO;IACH,2BAA2B,CACvB,SACA;KACI,OAAO;MACH,SAAS;MACT,MAAM;MACT;KACD,aAAa;KAChB,CACJ;IACD,mBAAmB;KACf;KACA;KACA;MACI,eAAe;MACf,SAAS;MACZ;KACJ;IACJ;GACJ;EACJ;AAED,KAAI,SAAS,eAAe,OAAO,QAAQ,eAAe,aAAa,QAAQ,WAAW,KACtF,aAAY,OACR,GACA,GACA,wBAAwB,MAAM,EAC9B,wBAAwB,OAAO,EAC/B,wBAAwB,OAAO,CAClC;AAGL,QAAO,MACH;EACI,YAAY;EACZ,GAAG;EACN,EACD,GAAG,YACN;;AAGL,SAAS,wBAAwB,QAAsD;AACnF,QAAO;EACH,OAAO,CAAC,QAAQ,SAAS;EACzB,iBAAiB,EAAE,QAAQ,OAAO,aAAa;EAC/C,SAAS,EAAE,QAAQ;EACnB,OAAO,EACH,mBAAmB,CACf,SACA;GACI;GACA,YAAY;GACZ,aAAa;GACb,UAAU;GACb,CACJ,EACJ;EACJ;;AAGL,MAAa,MAAM,aAAa,MAAM;AACtC,MAAa,OAAO,aAAa,OAAO;AACxC,MAAa,MAAM,aACf,QACA;CACI,YAAY,EAAE,KAAK,MAAM;CACzB,KAAK;CACR,CACJ"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kikiutils/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "4.0.0",
|
|
5
5
|
"description": "Using antfu/eslint-config as a base for eslint-config, slightly modified the settings and added additional plugins, mainly for my own use.",
|
|
6
6
|
"author": "kiki-kanri",
|
|
7
7
|
"license": "MIT",
|
|
@@ -12,7 +12,17 @@
|
|
|
12
12
|
"keywords": [],
|
|
13
13
|
"sideEffects": false,
|
|
14
14
|
"exports": {
|
|
15
|
-
".":
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"import": "./dist/index.js",
|
|
18
|
+
"require": null
|
|
19
|
+
},
|
|
20
|
+
"./*": "./dist/*.js",
|
|
21
|
+
"./index": {
|
|
22
|
+
"types": null,
|
|
23
|
+
"import": null,
|
|
24
|
+
"require": null
|
|
25
|
+
},
|
|
16
26
|
"./package.json": "./package.json"
|
|
17
27
|
},
|
|
18
28
|
"main": "./dist/index.js",
|
|
@@ -23,7 +33,7 @@
|
|
|
23
33
|
"./src"
|
|
24
34
|
],
|
|
25
35
|
"engines": {
|
|
26
|
-
"node": ">=22.
|
|
36
|
+
"node": ">=22.12.0"
|
|
27
37
|
},
|
|
28
38
|
"scripts": {
|
|
29
39
|
"build": "tsdown",
|
|
@@ -35,7 +45,7 @@
|
|
|
35
45
|
"release": "pnpm run lint && pnpm run typecheck && pnpm run test && pnpm run build && changelogen --hideAuthorEmail --push --release && npm publish",
|
|
36
46
|
"test": "vitest run --coverage",
|
|
37
47
|
"test:watch": "vitest watch --coverage",
|
|
38
|
-
"typecheck": "tsc --noEmit",
|
|
48
|
+
"typecheck": "tsc -b --noEmit",
|
|
39
49
|
"unused-exports": "ts-unused-exports ./tsconfig.json"
|
|
40
50
|
},
|
|
41
51
|
"peerDependencies": {
|
|
@@ -48,24 +58,24 @@
|
|
|
48
58
|
}
|
|
49
59
|
},
|
|
50
60
|
"dependencies": {
|
|
51
|
-
"@antfu/eslint-config": "^5.
|
|
52
|
-
"@kikiutils/eslint-plugin-tailwindcss": "
|
|
61
|
+
"@antfu/eslint-config": "^5.4.1",
|
|
62
|
+
"@kikiutils/eslint-plugin-tailwindcss": "^3.19.0",
|
|
53
63
|
"@kikiutils/eslint-plugin-vue": "^10.2.2",
|
|
54
|
-
"eslint-plugin-format": "^1.0.
|
|
64
|
+
"eslint-plugin-format": "^1.0.2",
|
|
55
65
|
"eslint-plugin-promise": "^7.2.1",
|
|
56
|
-
"eslint-plugin-tailwindcss": "
|
|
66
|
+
"eslint-plugin-tailwindcss": "^3.18.2"
|
|
57
67
|
},
|
|
58
68
|
"devDependencies": {
|
|
59
69
|
"@kikiutils/changelogen": "^0.9.0",
|
|
60
70
|
"@kikiutils/tsconfigs": "^5.0.5",
|
|
71
|
+
"@types/node": "^24.6.2",
|
|
61
72
|
"@vitest/coverage-v8": "^3.2.4",
|
|
62
73
|
"depcheck": "^1.4.7",
|
|
63
|
-
"eslint-flat-config-utils": "^2.1.
|
|
64
|
-
"publint": "^0.3.
|
|
74
|
+
"eslint-flat-config-utils": "^2.1.4",
|
|
75
|
+
"publint": "^0.3.13",
|
|
65
76
|
"ts-unused-exports": "^11.0.1",
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"typescript": "^5.9.2",
|
|
77
|
+
"tsdown": "^0.15.6",
|
|
78
|
+
"typescript": "^5.9.3",
|
|
69
79
|
"unplugin-unused": "^0.5.3",
|
|
70
80
|
"vitest": "^3.2.4"
|
|
71
81
|
},
|
package/src/index.ts
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { antfu } from '@antfu/eslint-config';
|
|
2
|
-
import type {
|
|
3
|
-
ConfigNames,
|
|
4
|
-
TypedFlatConfigItem,
|
|
5
|
-
} from '@antfu/eslint-config';
|
|
2
|
+
import type { TypedFlatConfigItem } from '@antfu/eslint-config';
|
|
6
3
|
// @ts-expect-error No declare file.
|
|
7
4
|
import kikiutilsTailwindcss from '@kikiutils/eslint-plugin-tailwindcss';
|
|
8
5
|
// @ts-expect-error Ignore this error.
|
|
9
6
|
import kikiutilsEslintPluginVue from '@kikiutils/eslint-plugin-vue';
|
|
10
|
-
|
|
7
|
+
// @ts-expect-error Ignore this error.
|
|
11
8
|
import format from 'eslint-plugin-format';
|
|
12
9
|
// @ts-expect-error No declare file.
|
|
13
10
|
import promise from 'eslint-plugin-promise';
|
|
@@ -19,10 +16,7 @@ const basePerfectionistSortOptions = {
|
|
|
19
16
|
type: 'natural',
|
|
20
17
|
} as const;
|
|
21
18
|
|
|
22
|
-
export function createConfig(
|
|
23
|
-
environment: 'bun' | 'node' = 'node',
|
|
24
|
-
options?: Parameters<typeof antfu>[0],
|
|
25
|
-
): FlatConfigComposer<TypedFlatConfigItem, ConfigNames> {
|
|
19
|
+
export function createConfig(environment: 'bun' | 'node' = 'node', options?: Parameters<typeof antfu>[0]) {
|
|
26
20
|
const userConfigs: Parameters<typeof antfu>[1] = [
|
|
27
21
|
{
|
|
28
22
|
files: ['**/*.{cjs,js,mjs,ts,tsx,vue}'],
|