@kikiutils/eslint-config 7.0.1 → 7.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/base.d.ts CHANGED
@@ -1,7 +1,8 @@
1
- import { TypedFlatConfigItem } from "@antfu/eslint-config";
1
+ import { Rules, TypedFlatConfigItem } from "@antfu/eslint-config";
2
2
 
3
3
  //#region src/base.d.ts
4
4
  declare function createBaseConfigs(environment?: 'bun' | 'node'): TypedFlatConfigItem[];
5
+ declare function createBaseRules(environment?: 'bun' | 'node'): Rules;
5
6
  //#endregion
6
- export { createBaseConfigs };
7
+ export { createBaseConfigs, createBaseRules };
7
8
  //# sourceMappingURL=base.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"base.d.ts","names":[],"sources":["../src/base.ts"],"mappings":";;;iBAYgB,iBAAA,CAAkB,WAAA,oBAAuC,mBAAA"}
1
+ {"version":3,"file":"base.d.ts","names":[],"sources":["../src/base.ts"],"mappings":";;;iBAYgB,iBAAA,CAAkB,WAAA,oBAAuC,mBAAA;AAAA,iBAyEzD,eAAA,CAAgB,WAAA,oBAAuC,KAAA"}
package/dist/base.js CHANGED
@@ -47,15 +47,6 @@ function createBaseConfigs(environment = "node") {
47
47
  }
48
48
  ]
49
49
  }
50
- },
51
- {
52
- files: ["**/*.{vue}"],
53
- plugins: { promise },
54
- rules: {
55
- ...createBaseRules(environment),
56
- "ts/consistent-generic-constructors": ["error", "constructor"],
57
- "ts/no-redeclare": "off"
58
- }
59
50
  }
60
51
  ];
61
52
  }
@@ -207,6 +198,6 @@ function createBaseRules(environment = "node") {
207
198
  };
208
199
  }
209
200
  //#endregion
210
- export { createBaseConfigs };
201
+ export { createBaseConfigs, createBaseRules };
211
202
 
212
203
  //# sourceMappingURL=base.js.map
package/dist/base.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"base.js","names":[],"sources":["../src/base.ts"],"sourcesContent":["import type {\n Rules,\n TypedFlatConfigItem,\n} from '@antfu/eslint-config';\n// @ts-expect-error No declare file.\nimport promise from 'eslint-plugin-promise';\n\nconst basePerfectionistSortOptions = {\n ignoreCase: false,\n type: 'natural',\n} as const;\n\nexport function createBaseConfigs(environment: 'bun' | 'node' = 'node'): TypedFlatConfigItem[] {\n return [\n // All files\n {\n rules: {\n 'e18e/ban-dependencies': [\n 'error',\n {\n allowed: [\n 'axios',\n 'rimraf',\n ],\n },\n ],\n 'e18e/prefer-static-regex': ['off'],\n },\n },\n // JavaScript\n {\n files: ['**/*.{cjs,js,mjs}'],\n plugins: { promise },\n rules: {\n ...createBaseRules(environment),\n 'node/prefer-global/process': [\n 'error',\n 'always',\n ],\n },\n },\n // TypeScript\n {\n files: ['**/*.{ts,tsx}'],\n plugins: { promise },\n rules: {\n ...createBaseRules(environment),\n 'node/prefer-global/process': [\n 'error',\n 'always',\n ],\n 'ts/consistent-generic-constructors': [\n 'error',\n 'constructor',\n ],\n 'ts/no-redeclare': 'off',\n },\n },\n // VsCode jsonc\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 // Vue\n {\n files: ['**/*.{vue}'],\n plugins: { promise },\n rules: {\n ...createBaseRules(environment),\n 'ts/consistent-generic-constructors': [\n 'error',\n 'constructor',\n ],\n 'ts/no-redeclare': 'off',\n },\n },\n ];\n}\n\nfunction createBaseRules(environment: 'bun' | 'node' = 'node'): Rules {\n return {\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 'perfectionist/sort-array-includes': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-enums': [\n 'error',\n {\n ...basePerfectionistSortOptions,\n sortByValue: 'never',\n },\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 'value-builtin',\n 'type-builtin',\n ],\n [\n 'value-external',\n 'type-external',\n ],\n [\n 'value-internal',\n 'type-internal',\n ],\n [\n 'value-parent',\n 'type-parent',\n ],\n [\n 'value-sibling',\n 'type-sibling',\n ],\n [\n 'value-index',\n 'type-index',\n ],\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 };\n}\n"],"mappings":";;AAOA,MAAM,+BAA+B;CACjC,YAAY;CACZ,MAAM;CACT;AAED,SAAgB,kBAAkB,cAA8B,QAA+B;AAC3F,QAAO;EAEH,EACI,OAAO;GACH,yBAAyB,CACrB,SACA,EACI,SAAS,CACL,SACA,SACH,EACJ,CACJ;GACD,4BAA4B,CAAC,MAAM;GACtC,EACJ;EAED;GACI,OAAO,CAAC,oBAAoB;GAC5B,SAAS,EAAE,SAAS;GACpB,OAAO;IACH,GAAG,gBAAgB,YAAY;IAC/B,8BAA8B,CAC1B,SACA,SACH;IACJ;GACJ;EAED;GACI,OAAO,CAAC,gBAAgB;GACxB,SAAS,EAAE,SAAS;GACpB,OAAO;IACH,GAAG,gBAAgB,YAAY;IAC/B,8BAA8B,CAC1B,SACA,SACH;IACD,sCAAsC,CAClC,SACA,cACH;IACD,mBAAmB;IACtB;GACJ;EAED;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;EAED;GACI,OAAO,CAAC,aAAa;GACrB,SAAS,EAAE,SAAS;GACpB,OAAO;IACH,GAAG,gBAAgB,YAAY;IAC/B,sCAAsC,CAClC,SACA,cACH;IACD,mBAAmB;IACtB;GACJ;EACJ;;AAGL,SAAS,gBAAgB,cAA8B,QAAe;AAClE,QAAO;EACH,iCAAiC,CAC7B,SACA;GACI,iBAAiB;GACjB,cAAc;GACjB,CACJ;EACD,eAAe;EACf,oBAAoB;EACpB,4BAA4B;EAC5B,SAAS,CACL,SACA,aACH;EACD,wBAAwB,CACpB,SACA,EACH;EACD,8BAA8B,CAC1B,SACA,EAAE,WAAW,MAAM,CACtB;EACD,qCAAqC,CACjC,SACA,6BACH;EACD,4BAA4B,CACxB,SACA;GACI,GAAG;GACH,aAAa;GAChB,CACJ;EACD,uCAAuC,CACnC,SACA;GACI,YAAY;GACZ,MAAM;GACT,CACJ;EACD,8BAA8B,CAC1B,SACA;GACI;GACA,QAAQ;IACJ;IACA;IACA;IACA,CACI,iBACA,eACH;IACD,CACI,kBACA,gBACH;IACD,CACI,kBACA,gBACH;IACD,CACI,gBACA,cACH;IACD,CACI,iBACA,eACH;IACD,CACI,eACA,aACH;IACD;IACH;GACD,YAAY;GACZ,iBAAiB;IACb;IACA;IACA;IACH;GACD,MAAM;GACT,CACJ;EACD,iCAAiC,CAC7B,SACA,6BACH;EACD,yCAAyC,CACrC,SACA,6BACH;EACD,2BAA2B,CACvB,SACA,6BACH;EACD,8BAA8B,CAC1B,SACA;GACI,GAAG;GACH,QAAQ;IACJ;IACA,CACI,eACA,OACH;IACD;IACA,CACI,oBACA,YACH;IACD;IACA,CACI,QACA,cACH;IACD;IACA,CACI,SACA,eACH;IACD;IACA,CACI,mBACA,WACH;IACJ;GACJ,CACJ;EACD,mCAAmC,CAC/B,SACA,6BACH;EACD,8BAA8B,CAC1B,SACA,6BACH;EACD,2BAA2B,CACvB,SACA,6BACH;EACD,kCAAkC,CAC9B,SACA;GACI,YAAY;GACZ,MAAM;GACT,CACJ;EACD,kCAAkC,CAC9B,SACA,6BACH;EACD,4CAA4C,CACxC,SACA,6BACH;EACD,gCAAgC;EAChC,gCAAgC;EAChC,0BAA0B;EAC1B,iBAAiB;EACjB,+BAA+B,CAC3B,SACA,EAAE,WAAW,MAAM,CACtB;EACD,+BAA+B,CAC3B,SACA;GACI,iBAAiB;IACb,YAAY;IACZ,UAAU;IACb;GACD,cAAc,EAAE,UAAU,GAAG;GAChC,CACJ;EACD,sBAAsB,CAClB,SACA,SACH;EACD,qBAAqB;GACjB;GACA;GACA,EAAE,iBAAiB,OAAO;GAC7B;EACD,+BAA+B,CAC3B,SACA,QACH;EACD,gBAAgB,CACZ,SACA,EACH;EACD,iBAAiB,CACb,QACA;GACI,MAAM;GACN,UAAU;GACb,CACJ;EACD,gCAAgC,CAC5B,SACA,EACI,WAAW;GACP,WAAW;GACX,aAAa;GAChB,EACJ,CACJ;EACD,yBAAyB;GACrB;GACA;GACA,EAAE,yBAAyB,OAAO;GACrC;EACD,uBAAuB;EACvB,8BAA8B,CAC1B,SACA;GACI,mBAAmB;IACf,eAAe;IACf,WAAW;IACd;GACD,mBAAmB;IACf,eAAe;IACf,WAAW;IACd;GACD,kBAAkB;IACd,eAAe;IACf,WAAW;IACd;GACD,eAAe;IACX,eAAe;IACf,WAAW;IACd;GACJ,CACJ;EACD,4BAA4B;GACxB;GACA;GACA,EAAE,WAAW,EAAE,KAAK,SAAS,EAAE;GAClC;EACD,yCAAyC;GACrC;GACA;IACI,WAAW;IACX,MAAM;KACF;KACA;KACA;KACH;IACD,MAAM;IACT;GACD;IACI,WAAW;IACX,MAAM;IACN,MAAM,CACF,SACA,WACH;IACJ;GACJ;EACD,cAAc,CACV,SACA,SACH;EACJ"}
1
+ {"version":3,"file":"base.js","names":[],"sources":["../src/base.ts"],"sourcesContent":["import type {\n Rules,\n TypedFlatConfigItem,\n} from '@antfu/eslint-config';\n// @ts-expect-error No declare file.\nimport promise from 'eslint-plugin-promise';\n\nconst basePerfectionistSortOptions = {\n ignoreCase: false,\n type: 'natural',\n} as const;\n\nexport function createBaseConfigs(environment: 'bun' | 'node' = 'node'): TypedFlatConfigItem[] {\n return [\n // All files\n {\n rules: {\n 'e18e/ban-dependencies': [\n 'error',\n {\n allowed: [\n 'axios',\n 'rimraf',\n ],\n },\n ],\n 'e18e/prefer-static-regex': ['off'],\n },\n },\n // JavaScript\n {\n files: ['**/*.{cjs,js,mjs}'],\n plugins: { promise },\n rules: {\n ...createBaseRules(environment),\n 'node/prefer-global/process': [\n 'error',\n 'always',\n ],\n },\n },\n // TypeScript\n {\n files: ['**/*.{ts,tsx}'],\n plugins: { promise },\n rules: {\n ...createBaseRules(environment),\n 'node/prefer-global/process': [\n 'error',\n 'always',\n ],\n 'ts/consistent-generic-constructors': [\n 'error',\n 'constructor',\n ],\n 'ts/no-redeclare': 'off',\n },\n },\n // VsCode jsonc\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\nexport function createBaseRules(environment: 'bun' | 'node' = 'node'): Rules {\n return {\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 'perfectionist/sort-array-includes': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-enums': [\n 'error',\n {\n ...basePerfectionistSortOptions,\n sortByValue: 'never',\n },\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 'value-builtin',\n 'type-builtin',\n ],\n [\n 'value-external',\n 'type-external',\n ],\n [\n 'value-internal',\n 'type-internal',\n ],\n [\n 'value-parent',\n 'type-parent',\n ],\n [\n 'value-sibling',\n 'type-sibling',\n ],\n [\n 'value-index',\n 'type-index',\n ],\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 };\n}\n"],"mappings":";;AAOA,MAAM,+BAA+B;CACjC,YAAY;CACZ,MAAM;CACT;AAED,SAAgB,kBAAkB,cAA8B,QAA+B;AAC3F,QAAO;EAEH,EACI,OAAO;GACH,yBAAyB,CACrB,SACA,EACI,SAAS,CACL,SACA,SACH,EACJ,CACJ;GACD,4BAA4B,CAAC,MAAM;GACtC,EACJ;EAED;GACI,OAAO,CAAC,oBAAoB;GAC5B,SAAS,EAAE,SAAS;GACpB,OAAO;IACH,GAAG,gBAAgB,YAAY;IAC/B,8BAA8B,CAC1B,SACA,SACH;IACJ;GACJ;EAED;GACI,OAAO,CAAC,gBAAgB;GACxB,SAAS,EAAE,SAAS;GACpB,OAAO;IACH,GAAG,gBAAgB,YAAY;IAC/B,8BAA8B,CAC1B,SACA,SACH;IACD,sCAAsC,CAClC,SACA,cACH;IACD,mBAAmB;IACtB;GACJ;EAED;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;;AAGL,SAAgB,gBAAgB,cAA8B,QAAe;AACzE,QAAO;EACH,iCAAiC,CAC7B,SACA;GACI,iBAAiB;GACjB,cAAc;GACjB,CACJ;EACD,eAAe;EACf,oBAAoB;EACpB,4BAA4B;EAC5B,SAAS,CACL,SACA,aACH;EACD,wBAAwB,CACpB,SACA,EACH;EACD,8BAA8B,CAC1B,SACA,EAAE,WAAW,MAAM,CACtB;EACD,qCAAqC,CACjC,SACA,6BACH;EACD,4BAA4B,CACxB,SACA;GACI,GAAG;GACH,aAAa;GAChB,CACJ;EACD,uCAAuC,CACnC,SACA;GACI,YAAY;GACZ,MAAM;GACT,CACJ;EACD,8BAA8B,CAC1B,SACA;GACI;GACA,QAAQ;IACJ;IACA;IACA;IACA,CACI,iBACA,eACH;IACD,CACI,kBACA,gBACH;IACD,CACI,kBACA,gBACH;IACD,CACI,gBACA,cACH;IACD,CACI,iBACA,eACH;IACD,CACI,eACA,aACH;IACD;IACH;GACD,YAAY;GACZ,iBAAiB;IACb;IACA;IACA;IACH;GACD,MAAM;GACT,CACJ;EACD,iCAAiC,CAC7B,SACA,6BACH;EACD,yCAAyC,CACrC,SACA,6BACH;EACD,2BAA2B,CACvB,SACA,6BACH;EACD,8BAA8B,CAC1B,SACA;GACI,GAAG;GACH,QAAQ;IACJ;IACA,CACI,eACA,OACH;IACD;IACA,CACI,oBACA,YACH;IACD;IACA,CACI,QACA,cACH;IACD;IACA,CACI,SACA,eACH;IACD;IACA,CACI,mBACA,WACH;IACJ;GACJ,CACJ;EACD,mCAAmC,CAC/B,SACA,6BACH;EACD,8BAA8B,CAC1B,SACA,6BACH;EACD,2BAA2B,CACvB,SACA,6BACH;EACD,kCAAkC,CAC9B,SACA;GACI,YAAY;GACZ,MAAM;GACT,CACJ;EACD,kCAAkC,CAC9B,SACA,6BACH;EACD,4CAA4C,CACxC,SACA,6BACH;EACD,gCAAgC;EAChC,gCAAgC;EAChC,0BAA0B;EAC1B,iBAAiB;EACjB,+BAA+B,CAC3B,SACA,EAAE,WAAW,MAAM,CACtB;EACD,+BAA+B,CAC3B,SACA;GACI,iBAAiB;IACb,YAAY;IACZ,UAAU;IACb;GACD,cAAc,EAAE,UAAU,GAAG;GAChC,CACJ;EACD,sBAAsB,CAClB,SACA,SACH;EACD,qBAAqB;GACjB;GACA;GACA,EAAE,iBAAiB,OAAO;GAC7B;EACD,+BAA+B,CAC3B,SACA,QACH;EACD,gBAAgB,CACZ,SACA,EACH;EACD,iBAAiB,CACb,QACA;GACI,MAAM;GACN,UAAU;GACb,CACJ;EACD,gCAAgC,CAC5B,SACA,EACI,WAAW;GACP,WAAW;GACX,aAAa;GAChB,EACJ,CACJ;EACD,yBAAyB;GACrB;GACA;GACA,EAAE,yBAAyB,OAAO;GACrC;EACD,uBAAuB;EACvB,8BAA8B,CAC1B,SACA;GACI,mBAAmB;IACf,eAAe;IACf,WAAW;IACd;GACD,mBAAmB;IACf,eAAe;IACf,WAAW;IACd;GACD,kBAAkB;IACd,eAAe;IACf,WAAW;IACd;GACD,eAAe;IACX,eAAe;IACf,WAAW;IACd;GACJ,CACJ;EACD,4BAA4B;GACxB;GACA;GACA,EAAE,WAAW,EAAE,KAAK,SAAS,EAAE;GAClC;EACD,yCAAyC;GACrC;GACA;IACI,WAAW;IACX,MAAM;KACF;KACA;KACA;KACH;IACD,MAAM;IACT;GACD;IACI,WAAW;IACX,MAAM;IACN,MAAM,CACF,SACA,WACH;IACJ;GACJ;EACD,cAAc,CACV,SACA,SACH;EACJ"}
package/dist/vue.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { TypedFlatConfigItem } from "@antfu/eslint-config";
2
2
 
3
3
  //#region src/vue.d.ts
4
- declare function createVueConfig(): TypedFlatConfigItem;
4
+ declare function createVueConfig(environment?: 'bun' | 'node'): TypedFlatConfigItem;
5
5
  //#endregion
6
6
  export { createVueConfig };
7
7
  //# sourceMappingURL=vue.d.ts.map
package/dist/vue.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"vue.d.ts","names":[],"sources":["../src/vue.ts"],"mappings":";;;iBAQgB,eAAA,CAAA,GAAmB,mBAAA"}
1
+ {"version":3,"file":"vue.d.ts","names":[],"sources":["../src/vue.ts"],"mappings":";;;iBAYgB,eAAA,CAAgB,WAAA,oBAAuC,mBAAA"}
package/dist/vue.js CHANGED
@@ -1,16 +1,20 @@
1
+ import { createBaseRules } from "./base.js";
2
+ import promise from "eslint-plugin-promise";
1
3
  import kikiutilsTailwindcss from "@kikiutils/eslint-plugin-tailwindcss";
2
4
  import kikiutilsEslintPluginVue from "@kikiutils/eslint-plugin-vue";
3
5
  import tailwindcss from "eslint-plugin-tailwindcss";
4
6
  //#region src/vue.ts
5
- function createVueConfig() {
7
+ function createVueConfig(environment = "node") {
6
8
  return {
7
9
  files: ["**/*.vue"],
8
10
  plugins: {
9
11
  "@kikiutils/tailwindcss": kikiutilsTailwindcss,
10
12
  "@kikiutils/vue": kikiutilsEslintPluginVue,
13
+ promise,
11
14
  tailwindcss
12
15
  },
13
16
  rules: {
17
+ ...createBaseRules(environment),
14
18
  "@kikiutils/tailwindcss/classnames-order": "error",
15
19
  "@kikiutils/vue/attributes-order": ["error", { alphabetical: true }],
16
20
  "@kikiutils/vue/no-extra-space-in-class": "error",
package/dist/vue.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"vue.js","names":[],"sources":["../src/vue.ts"],"sourcesContent":["import 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 No declare file.\nimport tailwindcss from 'eslint-plugin-tailwindcss';\n\nexport function createVueConfig(): TypedFlatConfigItem {\n return {\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"],"mappings":";;;;AAQA,SAAgB,kBAAuC;AACnD,QAAO;EACH,OAAO,CAAC,WAAW;EACnB,SAAS;GACL,0BAA0B;GAC1B,kBAAkB;GAClB;GACH;EACD,OAAO;GACH,2CAA2C;GAC3C,mCAAmC,CAC/B,SACA,EAAE,cAAc,MAAM,CACzB;GACD,0CAA0C;GAC1C,iBAAiB;GACjB,gCAAgC;GAChC,kDAAkD;GAClD,kCAAkC;GAClC,8CAA8C;GAC9C,6BAA6B;GAC7B,wBAAwB;GACxB,mBAAmB,CACf,SACA,EACI,OAAO;IACH;IACA;IACA;IACH,EACJ,CACJ;GACD,2BAA2B;GAC3B,gCAAgC;GAChC,gCAAgC;GAChC,+BAA+B;GAC/B,oCAAoC;GACpC,oCAAoC;GACpC,mBAAmB,CACf,SACA,EACH;GACD,+BAA+B,CAC3B,SACA;IACI,WAAW;IACX,YAAY;IACf,CACJ;GACD,eAAe,CACX,QACA;IACI,MAAM;IACN,UAAU;IACV,UAAU;IACb,CACJ;GACD,oBAAoB;GACpB,wBAAwB;GACxB,uBAAuB;GACvB,oCAAoC;GACpC,oBAAoB;GACpB,gCAAgC;GAChC,iBAAiB;GACjB,6BAA6B;GAC7B,oCAAoC;GACpC,8BAA8B;GAC9B,yBAAyB;GAC5B;EACJ"}
1
+ {"version":3,"file":"vue.js","names":[],"sources":["../src/vue.ts"],"sourcesContent":["import 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 No declare file.\nimport promise from 'eslint-plugin-promise';\n// @ts-expect-error No declare file.\nimport tailwindcss from 'eslint-plugin-tailwindcss';\n\nimport { createBaseRules } from './base';\n\nexport function createVueConfig(environment: 'bun' | 'node' = 'node'): TypedFlatConfigItem {\n return {\n files: ['**/*.vue'],\n plugins: {\n '@kikiutils/tailwindcss': kikiutilsTailwindcss,\n '@kikiutils/vue': kikiutilsEslintPluginVue,\n promise,\n tailwindcss,\n },\n rules: {\n ...createBaseRules(environment),\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"],"mappings":";;;;;;AAYA,SAAgB,gBAAgB,cAA8B,QAA6B;AACvF,QAAO;EACH,OAAO,CAAC,WAAW;EACnB,SAAS;GACL,0BAA0B;GAC1B,kBAAkB;GAClB;GACA;GACH;EACD,OAAO;GACH,GAAG,gBAAgB,YAAY;GAC/B,2CAA2C;GAC3C,mCAAmC,CAC/B,SACA,EAAE,cAAc,MAAM,CACzB;GACD,0CAA0C;GAC1C,iBAAiB;GACjB,gCAAgC;GAChC,kDAAkD;GAClD,kCAAkC;GAClC,8CAA8C;GAC9C,6BAA6B;GAC7B,wBAAwB;GACxB,mBAAmB,CACf,SACA,EACI,OAAO;IACH;IACA;IACA;IACH,EACJ,CACJ;GACD,2BAA2B;GAC3B,gCAAgC;GAChC,gCAAgC;GAChC,+BAA+B;GAC/B,oCAAoC;GACpC,oCAAoC;GACpC,mBAAmB,CACf,SACA,EACH;GACD,+BAA+B,CAC3B,SACA;IACI,WAAW;IACX,YAAY;IACf,CACJ;GACD,eAAe,CACX,QACA;IACI,MAAM;IACN,UAAU;IACV,UAAU;IACb,CACJ;GACD,oBAAoB;GACpB,wBAAwB;GACxB,uBAAuB;GACvB,oCAAoC;GACpC,oBAAoB;GACpB,gCAAgC;GAChC,iBAAiB;GACjB,6BAA6B;GAC7B,oCAAoC;GACpC,8BAA8B;GAC9B,yBAAyB;GAC5B;EACJ"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kikiutils/eslint-config",
3
3
  "type": "module",
4
- "version": "7.0.1",
4
+ "version": "7.0.2",
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",
package/src/base.ts CHANGED
@@ -80,23 +80,10 @@ export function createBaseConfigs(environment: 'bun' | 'node' = 'node'): TypedFl
80
80
  ],
81
81
  },
82
82
  },
83
- // Vue
84
- {
85
- files: ['**/*.{vue}'],
86
- plugins: { promise },
87
- rules: {
88
- ...createBaseRules(environment),
89
- 'ts/consistent-generic-constructors': [
90
- 'error',
91
- 'constructor',
92
- ],
93
- 'ts/no-redeclare': 'off',
94
- },
95
- },
96
83
  ];
97
84
  }
98
85
 
99
- function createBaseRules(environment: 'bun' | 'node' = 'node'): Rules {
86
+ export function createBaseRules(environment: 'bun' | 'node' = 'node'): Rules {
100
87
  return {
101
88
  'antfu/consistent-list-newline': [
102
89
  'error',
package/src/vue.ts CHANGED
@@ -4,17 +4,23 @@ import kikiutilsTailwindcss from '@kikiutils/eslint-plugin-tailwindcss';
4
4
  // @ts-expect-error Ignore this error.
5
5
  import kikiutilsEslintPluginVue from '@kikiutils/eslint-plugin-vue';
6
6
  // @ts-expect-error No declare file.
7
+ import promise from 'eslint-plugin-promise';
8
+ // @ts-expect-error No declare file.
7
9
  import tailwindcss from 'eslint-plugin-tailwindcss';
8
10
 
9
- export function createVueConfig(): TypedFlatConfigItem {
11
+ import { createBaseRules } from './base';
12
+
13
+ export function createVueConfig(environment: 'bun' | 'node' = 'node'): TypedFlatConfigItem {
10
14
  return {
11
15
  files: ['**/*.vue'],
12
16
  plugins: {
13
17
  '@kikiutils/tailwindcss': kikiutilsTailwindcss,
14
18
  '@kikiutils/vue': kikiutilsEslintPluginVue,
19
+ promise,
15
20
  tailwindcss,
16
21
  },
17
22
  rules: {
23
+ ...createBaseRules(environment),
18
24
  '@kikiutils/tailwindcss/classnames-order': 'error',
19
25
  '@kikiutils/vue/attributes-order': [
20
26
  'error',