@kikiutils/eslint-config 11.2.1 → 11.4.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/dist/_internals/configs/base-rules.d.ts +3 -0
- package/dist/_internals/configs/base-rules.d.ts.map +1 -0
- package/dist/_internals/configs/base-rules.js +190 -0
- package/dist/_internals/configs/base-rules.js.map +1 -0
- package/dist/_internals/configs/jsdoc.d.ts.map +1 -0
- package/dist/_internals/{jsdoc.js → configs/jsdoc.js} +1 -1
- package/dist/_internals/configs/jsdoc.js.map +1 -0
- package/dist/_internals/configs/restricted-syntax.d.ts.map +1 -0
- package/dist/_internals/configs/restricted-syntax.js +12 -0
- package/dist/_internals/configs/restricted-syntax.js.map +1 -0
- package/dist/_internals/configs/type-aware.d.ts.map +1 -0
- package/dist/_internals/configs/type-aware.js +48 -0
- package/dist/_internals/configs/type-aware.js.map +1 -0
- package/dist/_internals/configs/typefest.d.ts.map +1 -0
- package/dist/_internals/{typefest.js → configs/typefest.js} +1 -1
- package/dist/_internals/configs/typefest.js.map +1 -0
- package/dist/_internals/rules/comment-indent.d.ts +3 -0
- package/dist/_internals/rules/comment-indent.d.ts.map +1 -0
- package/dist/_internals/rules/comment-indent.js +58 -0
- package/dist/_internals/rules/comment-indent.js.map +1 -0
- package/dist/_internals/rules/index.d.ts +19 -0
- package/dist/_internals/rules/index.d.ts.map +1 -0
- package/dist/_internals/rules/index.js +34 -0
- package/dist/_internals/rules/index.js.map +1 -0
- package/dist/_internals/rules/nitro-route-method-suffix.d.ts +3 -0
- package/dist/_internals/rules/nitro-route-method-suffix.d.ts.map +1 -0
- package/dist/_internals/rules/nitro-route-method-suffix.js +25 -0
- package/dist/_internals/rules/nitro-route-method-suffix.js.map +1 -0
- package/dist/_internals/rules/no-composable-in-head-getter.d.ts +3 -0
- package/dist/_internals/rules/no-composable-in-head-getter.d.ts.map +1 -0
- package/dist/_internals/rules/no-composable-in-head-getter.js +41 -0
- package/dist/_internals/rules/no-composable-in-head-getter.js.map +1 -0
- package/dist/_internals/rules/no-silent-catch.d.ts +3 -0
- package/dist/_internals/rules/no-silent-catch.d.ts.map +1 -0
- package/dist/_internals/rules/no-silent-catch.js +38 -0
- package/dist/_internals/rules/no-silent-catch.js.map +1 -0
- package/dist/_internals/rules/no-thenable-zod-refinement.d.ts +3 -0
- package/dist/_internals/rules/no-thenable-zod-refinement.d.ts.map +1 -0
- package/dist/_internals/rules/no-thenable-zod-refinement.js +41 -0
- package/dist/_internals/rules/no-thenable-zod-refinement.js.map +1 -0
- package/dist/_internals/rules/promise-function-async.d.ts +3 -0
- package/dist/_internals/rules/promise-function-async.d.ts.map +1 -0
- package/dist/_internals/rules/promise-function-async.js +32 -0
- package/dist/_internals/rules/promise-function-async.js.map +1 -0
- package/dist/_internals/rules/statement-padding.js +2 -1
- package/dist/_internals/rules/statement-padding.js.map +1 -1
- package/dist/base.d.ts +3 -2
- package/dist/base.d.ts.map +1 -1
- package/dist/base.js +6 -183
- package/dist/base.js.map +1 -1
- package/dist/nuxt.d.ts +3 -0
- package/dist/nuxt.d.ts.map +1 -0
- package/dist/nuxt.js +94 -0
- package/dist/nuxt.js.map +1 -0
- package/dist/vue.d.ts.map +1 -1
- package/dist/vue.js +11 -14
- package/dist/vue.js.map +1 -1
- package/package.json +8 -6
- package/src/_internals/configs/base-rules.ts +335 -0
- package/src/_internals/{restricted-syntax.ts → configs/restricted-syntax.ts} +0 -4
- package/src/_internals/configs/type-aware.ts +70 -0
- package/src/_internals/rules/comment-indent.ts +87 -0
- package/src/_internals/rules/index.ts +38 -0
- package/src/_internals/rules/nitro-route-method-suffix.ts +27 -0
- package/src/_internals/rules/no-composable-in-head-getter.ts +52 -0
- package/src/_internals/rules/no-silent-catch.ts +58 -0
- package/src/_internals/rules/no-thenable-zod-refinement.ts +70 -0
- package/src/_internals/rules/promise-function-async.ts +56 -0
- package/src/_internals/rules/statement-padding.ts +1 -0
- package/src/base.ts +9 -334
- package/src/nuxt.ts +131 -0
- package/src/vue.ts +11 -14
- package/dist/_internals/jsdoc.d.ts.map +0 -1
- package/dist/_internals/jsdoc.js.map +0 -1
- package/dist/_internals/plugins.d.ts +0 -9
- package/dist/_internals/plugins.d.ts.map +0 -1
- package/dist/_internals/plugins.js +0 -14
- package/dist/_internals/plugins.js.map +0 -1
- package/dist/_internals/restricted-syntax.d.ts.map +0 -1
- package/dist/_internals/restricted-syntax.js +0 -16
- package/dist/_internals/restricted-syntax.js.map +0 -1
- package/dist/_internals/type-aware.d.ts.map +0 -1
- package/dist/_internals/type-aware.js +0 -29
- package/dist/_internals/type-aware.js.map +0 -1
- package/dist/_internals/typefest.d.ts.map +0 -1
- package/dist/_internals/typefest.js.map +0 -1
- package/src/_internals/plugins.ts +0 -13
- package/src/_internals/type-aware.ts +0 -42
- /package/dist/_internals/{jsdoc.d.ts → configs/jsdoc.d.ts} +0 -0
- /package/dist/_internals/{restricted-syntax.d.ts → configs/restricted-syntax.d.ts} +0 -0
- /package/dist/_internals/{type-aware.d.ts → configs/type-aware.d.ts} +0 -0
- /package/dist/_internals/{typefest.d.ts → configs/typefest.d.ts} +0 -0
- /package/src/_internals/{jsdoc.ts → configs/jsdoc.ts} +0 -0
- /package/src/_internals/{typefest.ts → configs/typefest.ts} +0 -0
package/src/nuxt.ts
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
|
|
4
|
+
import type { TypedFlatConfigItem } from '@antfu/eslint-config';
|
|
5
|
+
import {
|
|
6
|
+
GLOB_SRC,
|
|
7
|
+
GLOB_TESTS,
|
|
8
|
+
GLOB_VUE,
|
|
9
|
+
} from '@antfu/eslint-config';
|
|
10
|
+
|
|
11
|
+
import { customPlugins } from './_internals/rules';
|
|
12
|
+
|
|
13
|
+
// Server helpers that `nuxt/server` provides since Nuxt 4.6.
|
|
14
|
+
const nuxtServerHelpers = [
|
|
15
|
+
'clearSession',
|
|
16
|
+
'createError',
|
|
17
|
+
'defineEventHandler',
|
|
18
|
+
'defineHandler',
|
|
19
|
+
'deleteCookie',
|
|
20
|
+
'eventHandler',
|
|
21
|
+
'getCookie',
|
|
22
|
+
'getQuery',
|
|
23
|
+
'getRequestHeader',
|
|
24
|
+
'getRequestHeaders',
|
|
25
|
+
'getRequestHost',
|
|
26
|
+
'getRequestIP',
|
|
27
|
+
'getRequestProtocol',
|
|
28
|
+
'getRequestURL',
|
|
29
|
+
'getRouteRules',
|
|
30
|
+
'getRouterParam',
|
|
31
|
+
'getRouterParams',
|
|
32
|
+
'getSession',
|
|
33
|
+
'getValidatedQuery',
|
|
34
|
+
'handleCors',
|
|
35
|
+
'parseCookies',
|
|
36
|
+
'readBody',
|
|
37
|
+
'readValidatedBody',
|
|
38
|
+
'sendRedirect',
|
|
39
|
+
'setCookie',
|
|
40
|
+
'setResponseStatus',
|
|
41
|
+
'updateSession',
|
|
42
|
+
'useAppConfig',
|
|
43
|
+
'useRuntimeConfig',
|
|
44
|
+
'useSession',
|
|
45
|
+
];
|
|
46
|
+
|
|
47
|
+
export function createNuxtConfigs(): TypedFlatConfigItem[] {
|
|
48
|
+
const nuxtRestrictedSyntax = [
|
|
49
|
+
{
|
|
50
|
+
message: 'Do not redirect with a top-level `await navigateTo()` in setup: under KeepAlive it interrupts a pending Suspense and leaves the page stuck. Use `definePageMeta({ redirect })` or a route middleware.',
|
|
51
|
+
selector: 'Program > ExpressionStatement > AwaitExpression > CallExpression[callee.name="navigateTo"]',
|
|
52
|
+
},
|
|
53
|
+
...hasSeoUtils()
|
|
54
|
+
? [
|
|
55
|
+
{
|
|
56
|
+
message: 'nuxt-seo-utils infers og:title and og:description from `title` and `description`, X falls back to them for its title and description, and the seo layer sets `twitter:card`. Setting these keys stops the inference; set `title` and `description` instead.',
|
|
57
|
+
selector: 'CallExpression[callee.name=/^use(Server)?SeoMeta$/] > ObjectExpression > Property[key.name=/^(ogDescription|ogTitle|twitterCard|twitterDescription|twitterTitle)$/]',
|
|
58
|
+
},
|
|
59
|
+
]
|
|
60
|
+
: [],
|
|
61
|
+
];
|
|
62
|
+
|
|
63
|
+
return [
|
|
64
|
+
{
|
|
65
|
+
files: [
|
|
66
|
+
GLOB_SRC,
|
|
67
|
+
GLOB_VUE,
|
|
68
|
+
],
|
|
69
|
+
plugins: { kikiutils: customPlugins },
|
|
70
|
+
rules: {
|
|
71
|
+
'kikiutils/no-composable-in-head-getter': 'error',
|
|
72
|
+
'kikiutils/no-restricted-nuxt-syntax': [
|
|
73
|
+
'error',
|
|
74
|
+
...nuxtRestrictedSyntax,
|
|
75
|
+
],
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
files: ['**/pages/**/*.{ts,vue}'],
|
|
80
|
+
rules: {
|
|
81
|
+
'kikiutils/no-restricted-nuxt-page-syntax': [
|
|
82
|
+
'error',
|
|
83
|
+
{
|
|
84
|
+
message: '`<html lang>` follows the current locale through the i18n layer, or `app.head` in `nuxt.config.ts` without i18n; setting it in a page overrides it.',
|
|
85
|
+
selector: 'CallExpression[callee.name=/^use(Server)?Head(Safe)?$/] Property[key.name="htmlAttrs"] > ObjectExpression > Property[key.name="lang"]',
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
files: ['**/server/{api,routes}/**/*.?([cm])[jt]s'],
|
|
92
|
+
ignores: GLOB_TESTS,
|
|
93
|
+
rules: { 'kikiutils/nitro-route-method-suffix': 'error' },
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
files: ['**/server/**/*.?([cm])[jt]s'],
|
|
97
|
+
rules: {
|
|
98
|
+
'kikiutils/no-restricted-nuxt-server-imports': [
|
|
99
|
+
'error',
|
|
100
|
+
{
|
|
101
|
+
paths: [
|
|
102
|
+
'#imports',
|
|
103
|
+
'h3',
|
|
104
|
+
'nitropack/runtime',
|
|
105
|
+
].map((name) => ({
|
|
106
|
+
importNames: nuxtServerHelpers,
|
|
107
|
+
message: 'Import this helper from `nuxt/server`, which runs on Nuxt 4.6 and Nuxt 5; the h3 and Nitro versions expect a different event. Keep h3 or `nitropack/runtime` only for helpers `nuxt/server` does not provide.',
|
|
108
|
+
name,
|
|
109
|
+
})),
|
|
110
|
+
},
|
|
111
|
+
],
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
];
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function hasSeoUtils(): boolean {
|
|
118
|
+
try {
|
|
119
|
+
const { dependencies, devDependencies } = JSON.parse(readFileSync(join(process.cwd(), 'package.json'), 'utf8'));
|
|
120
|
+
return [
|
|
121
|
+
'@nuxtjs/seo',
|
|
122
|
+
'nuxt-seo-utils',
|
|
123
|
+
].some((name) => name in {
|
|
124
|
+
...dependencies,
|
|
125
|
+
...devDependencies,
|
|
126
|
+
});
|
|
127
|
+
} catch {
|
|
128
|
+
// Without a readable package.json, skip the rules that depend on the SEO modules.
|
|
129
|
+
return false;
|
|
130
|
+
}
|
|
131
|
+
}
|
package/src/vue.ts
CHANGED
|
@@ -4,12 +4,11 @@ import betterTailwindcss from 'eslint-plugin-better-tailwindcss';
|
|
|
4
4
|
// @ts-expect-error No declare file.
|
|
5
5
|
import promise from 'eslint-plugin-promise';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { createBaseRules } from './base';
|
|
7
|
+
import { createBaseRules } from './_internals/configs/base-rules';
|
|
8
|
+
import { typescriptJsdocConfig } from './_internals/configs/jsdoc';
|
|
9
|
+
import { createTypeAwareConfig } from './_internals/configs/type-aware';
|
|
10
|
+
import { createTypefestConfig } from './_internals/configs/typefest';
|
|
11
|
+
import { customPlugins } from './_internals/rules';
|
|
13
12
|
|
|
14
13
|
export function createVueConfig(environment: 'bun' | 'node' = 'node'): TypedFlatConfigItem {
|
|
15
14
|
const typeAwareConfig = createTypeAwareConfig();
|
|
@@ -45,14 +44,6 @@ export function createVueConfig(environment: 'bun' | 'node' = 'node'): TypedFlat
|
|
|
45
44
|
'better-tailwindcss/no-deprecated-classes': 'warn',
|
|
46
45
|
'better-tailwindcss/no-duplicate-classes': 'error',
|
|
47
46
|
'better-tailwindcss/no-unnecessary-whitespace': 'error',
|
|
48
|
-
'no-restricted-syntax': [
|
|
49
|
-
'error',
|
|
50
|
-
...restrictedSyntax,
|
|
51
|
-
{
|
|
52
|
-
message: 'Do not redirect with a top-level `await navigateTo()` in setup: under KeepAlive it interrupts a pending Suspense and leaves the page stuck. Use `definePageMeta({ redirect })` or a route middleware.',
|
|
53
|
-
selector: 'Program > ExpressionStatement > AwaitExpression > CallExpression[callee.name="navigateTo"]',
|
|
54
|
-
},
|
|
55
|
-
],
|
|
56
47
|
'style/max-len': 'off',
|
|
57
48
|
'ts/array-type': [
|
|
58
49
|
'error',
|
|
@@ -98,14 +89,20 @@ export function createVueConfig(environment: 'bun' | 'node' = 'node'): TypedFlat
|
|
|
98
89
|
},
|
|
99
90
|
],
|
|
100
91
|
'vue/no-dupe-keys': 'error',
|
|
92
|
+
'vue/no-import-compiler-macros': 'error',
|
|
101
93
|
'vue/no-lone-template': 'error',
|
|
102
94
|
'vue/no-multi-spaces': 'error',
|
|
103
95
|
'vue/no-multiple-objects-in-class': 'error',
|
|
104
96
|
'vue/no-root-v-if': 'error',
|
|
105
97
|
'vue/no-template-target-blank': 'error',
|
|
98
|
+
'vue/no-unused-emit-declarations': 'error',
|
|
99
|
+
'vue/no-unused-properties': 'error',
|
|
100
|
+
'vue/no-useless-mustaches': 'error',
|
|
106
101
|
'vue/no-v-html': 'error',
|
|
107
102
|
'vue/prefer-define-options': 'error',
|
|
103
|
+
'vue/prefer-use-template-ref': 'error',
|
|
108
104
|
'vue/require-explicit-emits': 'error',
|
|
105
|
+
'vue/require-macro-variable-name': 'error',
|
|
109
106
|
'vue/require-typed-ref': 'error',
|
|
110
107
|
},
|
|
111
108
|
settings: typescriptJsdocConfig.settings,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jsdoc.d.ts","names":[],"sources":["../../src/_internals/jsdoc.ts"],"mappings":"A,qBAEa;;;;;;;;;;;;;qBAcA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jsdoc.js","names":[],"sources":["../../src/_internals/jsdoc.ts"],"sourcesContent":["import type { TypedFlatConfigItem } from '@antfu/eslint-config';\n\nexport const jsdocSettings = {\n jsdoc: {\n tagNamePreference: {\n arg: 'param',\n argument: 'param',\n desc: false,\n description: false,\n exception: 'throws',\n return: 'returns',\n types: false,\n },\n },\n};\n\nexport const typescriptJsdocConfig = {\n rules: {\n 'jsdoc/check-tag-names': [\n 'error',\n {\n definedTags: [\n 'alpha',\n 'beta',\n 'defaultValue',\n 'eventProperty',\n 'experimental',\n 'hidden',\n 'inheritDoc',\n 'internal',\n 'packageDocumentation',\n 'privateRemarks',\n 'remarks',\n 'sealed',\n 'typeParam',\n 'virtual',\n ],\n },\n ],\n 'jsdoc/multiline-blocks': [\n 'error',\n {\n noSingleLineBlocks: true,\n singleLineTags: [],\n },\n ],\n 'jsdoc/no-types': 'error',\n },\n settings: {\n jsdoc: {\n mode: 'typescript',\n tagNamePreference: {\n ...jsdocSettings.jsdoc.tagNamePreference,\n callback: false,\n class: false,\n constructor: false,\n default: 'defaultValue',\n function: false,\n method: false,\n readonly: false,\n static: false,\n template: false,\n type: false,\n typedef: false,\n typeParam: 'typeParam',\n virtual: 'virtual',\n },\n },\n },\n} satisfies TypedFlatConfigItem;\n"],"mappings":";AAEA,MAAa,gBAAgB,EACzB,OAAO,EACH,mBAAmB;CACf,KAAK;CACL,UAAU;CACV,MAAM;CACN,aAAa;CACb,WAAW;CACX,QAAQ;CACR,OAAO;AACX,EACJ,EACJ;AAEA,MAAa,wBAAwB;CACjC,OAAO;EACH,yBAAyB,CACrB,SACA,EACI,aAAa;GACT;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACJ,EACJ,CACJ;EACA,0BAA0B,CACtB,SACA;GACI,oBAAoB;GACpB,gBAAgB,CAAC;EACrB,CACJ;EACA,kBAAkB;CACtB;CACA,UAAU,EACN,OAAO;EACH,MAAM;EACN,mBAAmB;GACf,GAAG,cAAc,MAAM;GACvB,UAAU;GACV,OAAO;GACP,aAAa;GACb,SAAS;GACT,UAAU;GACV,QAAQ;GACR,UAAU;GACV,QAAQ;GACR,UAAU;GACV,MAAM;GACN,SAAS;GACT,WAAW;GACX,SAAS;EACb;CACJ,EACJ;AACJ"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare const customPlugins: {
|
|
2
|
-
rules: {
|
|
3
|
-
'compact-iteration-layout': import("eslint").Rule.RuleModule;
|
|
4
|
-
'consistent-condition-layout': import("eslint").Rule.RuleModule;
|
|
5
|
-
'consistent-parameter-layout': import("eslint").Rule.RuleModule;
|
|
6
|
-
'statement-padding': import("eslint").Rule.RuleModule;
|
|
7
|
-
};
|
|
8
|
-
};
|
|
9
|
-
//# sourceMappingURL=plugins.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugins.d.ts","names":[],"sources":["../../src/_internals/plugins.ts"],"mappings":"A,qBAKa"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { compactIterationLayout } from "./rules/compact-iteration-layout.js";
|
|
2
|
-
import { consistentConditionLayout } from "./rules/consistent-condition-layout.js";
|
|
3
|
-
import { consistentParameterLayout } from "./rules/consistent-parameter-layout.js";
|
|
4
|
-
import { statementPadding } from "./rules/statement-padding.js";
|
|
5
|
-
// src/_internals/plugins.ts
|
|
6
|
-
const customPlugins = { rules: {
|
|
7
|
-
"compact-iteration-layout": compactIterationLayout,
|
|
8
|
-
"consistent-condition-layout": consistentConditionLayout,
|
|
9
|
-
"consistent-parameter-layout": consistentParameterLayout,
|
|
10
|
-
"statement-padding": statementPadding
|
|
11
|
-
} };
|
|
12
|
-
export { customPlugins };
|
|
13
|
-
|
|
14
|
-
//# sourceMappingURL=plugins.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugins.js","names":[],"sources":["../../src/_internals/plugins.ts"],"sourcesContent":["import { compactIterationLayout } from './rules/compact-iteration-layout';\nimport { consistentConditionLayout } from './rules/consistent-condition-layout';\nimport { consistentParameterLayout } from './rules/consistent-parameter-layout';\nimport { statementPadding } from './rules/statement-padding';\n\nexport const customPlugins = {\n rules: {\n 'compact-iteration-layout': compactIterationLayout,\n 'consistent-condition-layout': consistentConditionLayout,\n 'consistent-parameter-layout': consistentParameterLayout,\n 'statement-padding': statementPadding,\n },\n};\n"],"mappings":";;;;;AAKA,MAAa,gBAAgB,EACzB,OAAO;CACH,4BAA4B;CAC5B,+BAA+B;CAC/B,+BAA+B;CAC/B,qBAAqB;AACzB,EACJ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"restricted-syntax.d.ts","names":[],"sources":["../../src/_internals/restricted-syntax.ts"],"mappings":"A,qBAAa"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// src/_internals/restricted-syntax.ts
|
|
2
|
-
const restrictedSyntax = [
|
|
3
|
-
"TSEnumDeclaration[const=true]",
|
|
4
|
-
"TSExportAssignment",
|
|
5
|
-
{
|
|
6
|
-
message: "Use `axios.isAxiosError(error)`; `instanceof` fails when the error comes from another copy of axios.",
|
|
7
|
-
selector: "BinaryExpression[operator=\"instanceof\"][right.name=\"AxiosError\"]"
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
message: "Do not swallow the rejection silently: log it, or handle it in a way that shows why it can be ignored.",
|
|
11
|
-
selector: "CallExpression[callee.property.name=\"catch\"] > ArrowFunctionExpression[body.type=\"BlockStatement\"][body.body.length=0]"
|
|
12
|
-
}
|
|
13
|
-
];
|
|
14
|
-
export { restrictedSyntax };
|
|
15
|
-
|
|
16
|
-
//# sourceMappingURL=restricted-syntax.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"restricted-syntax.js","names":[],"sources":["../../src/_internals/restricted-syntax.ts"],"sourcesContent":["export const restrictedSyntax = [\n 'TSEnumDeclaration[const=true]',\n 'TSExportAssignment',\n {\n message: 'Use `axios.isAxiosError(error)`; `instanceof` fails when the error comes from another copy of axios.',\n selector: 'BinaryExpression[operator=\"instanceof\"][right.name=\"AxiosError\"]',\n },\n {\n message: 'Do not swallow the rejection silently: log it, or handle it in a way that shows why it can be ignored.',\n selector: 'CallExpression[callee.property.name=\"catch\"] > ArrowFunctionExpression[body.type=\"BlockStatement\"][body.body.length=0]',\n },\n];\n"],"mappings":";AAAA,MAAa,mBAAmB;CAC5B;CACA;CACA;EACI,SAAS;EACT,UAAU;CACd;CACA;EACI,SAAS;EACT,UAAU;CACd;AACJ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"type-aware.d.ts","names":[],"sources":["../../src/_internals/type-aware.ts"],"mappings":";wBAEgB,yBAAyB"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
// src/_internals/type-aware.ts
|
|
2
|
-
function createTypeAwareConfig() {
|
|
3
|
-
return {
|
|
4
|
-
languageOptions: { parserOptions: {
|
|
5
|
-
projectService: true,
|
|
6
|
-
tsconfigRootDir: process.cwd()
|
|
7
|
-
} },
|
|
8
|
-
rules: {
|
|
9
|
-
"ts/await-thenable": "error",
|
|
10
|
-
"ts/no-base-to-string": "error",
|
|
11
|
-
"ts/no-floating-promises": ["error", { allowForKnownSafePromises: [{
|
|
12
|
-
from: "package",
|
|
13
|
-
name: "SafePromise",
|
|
14
|
-
package: "@kikiutils/shared"
|
|
15
|
-
}] }],
|
|
16
|
-
"ts/no-for-in-array": "error",
|
|
17
|
-
"ts/no-misused-promises": "error",
|
|
18
|
-
"ts/no-misused-spread": "error",
|
|
19
|
-
"ts/no-unnecessary-type-assertion": "error",
|
|
20
|
-
"ts/promise-function-async": "error",
|
|
21
|
-
"ts/require-await": "off",
|
|
22
|
-
"ts/return-await": ["error", "always"],
|
|
23
|
-
"ts/switch-exhaustiveness-check": ["error", { considerDefaultExhaustiveForUnions: true }]
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
export { createTypeAwareConfig };
|
|
28
|
-
|
|
29
|
-
//# sourceMappingURL=type-aware.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"type-aware.js","names":[],"sources":["../../src/_internals/type-aware.ts"],"sourcesContent":["import type { TypedFlatConfigItem } from '@antfu/eslint-config';\n\nexport function createTypeAwareConfig(): TypedFlatConfigItem {\n return {\n languageOptions: {\n parserOptions: {\n projectService: true,\n tsconfigRootDir: process.cwd(),\n },\n },\n rules: {\n 'ts/await-thenable': 'error',\n 'ts/no-base-to-string': 'error',\n 'ts/no-floating-promises': [\n 'error',\n {\n allowForKnownSafePromises: [\n {\n from: 'package',\n name: 'SafePromise',\n package: '@kikiutils/shared',\n },\n ],\n },\n ],\n 'ts/no-for-in-array': 'error',\n 'ts/no-misused-promises': 'error',\n 'ts/no-misused-spread': 'error',\n 'ts/no-unnecessary-type-assertion': 'error',\n 'ts/promise-function-async': 'error',\n 'ts/require-await': 'off',\n 'ts/return-await': [\n 'error',\n 'always',\n ],\n 'ts/switch-exhaustiveness-check': [\n 'error',\n { considerDefaultExhaustiveForUnions: true },\n ],\n },\n };\n}\n"],"mappings":";AAEA,SAAgB,wBAA6C;CACzD,OAAO;EACH,iBAAiB,EACb,eAAe;GACX,gBAAgB;GAChB,iBAAiB,QAAQ,IAAI;EACjC,EACJ;EACA,OAAO;GACH,qBAAqB;GACrB,wBAAwB;GACxB,2BAA2B,CACvB,SACA,EACI,2BAA2B,CACvB;IACI,MAAM;IACN,MAAM;IACN,SAAS;GACb,CACJ,EACJ,CACJ;GACA,sBAAsB;GACtB,0BAA0B;GAC1B,wBAAwB;GACxB,oCAAoC;GACpC,6BAA6B;GAC7B,oBAAoB;GACpB,mBAAmB,CACf,SACA,QACJ;GACA,kCAAkC,CAC9B,SACA,EAAE,oCAAoC,KAAK,CAC/C;EACJ;CACJ;AACJ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typefest.d.ts","names":[],"sources":["../../src/_internals/typefest.ts"],"mappings":";wBAGgB,wBAAwB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typefest.js","names":[],"sources":["../../src/_internals/typefest.ts"],"sourcesContent":["import type { TypedFlatConfigItem } from '@antfu/eslint-config';\nimport typefest from 'eslint-plugin-typefest';\n\nexport function createTypefestConfig(): TypedFlatConfigItem {\n return {\n plugins: { typefest },\n rules: {\n 'typefest/prefer-ts-extras-is-present-filter': 'error',\n 'typefest/prefer-ts-extras-object-entries': 'error',\n 'typefest/prefer-ts-extras-object-has-own': 'error',\n 'typefest/prefer-ts-extras-object-keys': 'error',\n 'typefest/prefer-ts-extras-object-values': 'error',\n 'typefest/prefer-type-fest-array-values': 'error',\n 'typefest/prefer-type-fest-arrayable': 'error',\n 'typefest/prefer-type-fest-unknown-record': 'error',\n 'typefest/prefer-type-fest-value-of': 'error',\n },\n };\n}\n"],"mappings":";;AAGA,SAAgB,uBAA4C;CACxD,OAAO;EACH,SAAS,EAAE,SAAS;EACpB,OAAO;GACH,+CAA+C;GAC/C,4CAA4C;GAC5C,4CAA4C;GAC5C,yCAAyC;GACzC,2CAA2C;GAC3C,0CAA0C;GAC1C,uCAAuC;GACvC,4CAA4C;GAC5C,sCAAsC;EAC1C;CACJ;AACJ"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { compactIterationLayout } from './rules/compact-iteration-layout';
|
|
2
|
-
import { consistentConditionLayout } from './rules/consistent-condition-layout';
|
|
3
|
-
import { consistentParameterLayout } from './rules/consistent-parameter-layout';
|
|
4
|
-
import { statementPadding } from './rules/statement-padding';
|
|
5
|
-
|
|
6
|
-
export const customPlugins = {
|
|
7
|
-
rules: {
|
|
8
|
-
'compact-iteration-layout': compactIterationLayout,
|
|
9
|
-
'consistent-condition-layout': consistentConditionLayout,
|
|
10
|
-
'consistent-parameter-layout': consistentParameterLayout,
|
|
11
|
-
'statement-padding': statementPadding,
|
|
12
|
-
},
|
|
13
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import type { TypedFlatConfigItem } from '@antfu/eslint-config';
|
|
2
|
-
|
|
3
|
-
export function createTypeAwareConfig(): TypedFlatConfigItem {
|
|
4
|
-
return {
|
|
5
|
-
languageOptions: {
|
|
6
|
-
parserOptions: {
|
|
7
|
-
projectService: true,
|
|
8
|
-
tsconfigRootDir: process.cwd(),
|
|
9
|
-
},
|
|
10
|
-
},
|
|
11
|
-
rules: {
|
|
12
|
-
'ts/await-thenable': 'error',
|
|
13
|
-
'ts/no-base-to-string': 'error',
|
|
14
|
-
'ts/no-floating-promises': [
|
|
15
|
-
'error',
|
|
16
|
-
{
|
|
17
|
-
allowForKnownSafePromises: [
|
|
18
|
-
{
|
|
19
|
-
from: 'package',
|
|
20
|
-
name: 'SafePromise',
|
|
21
|
-
package: '@kikiutils/shared',
|
|
22
|
-
},
|
|
23
|
-
],
|
|
24
|
-
},
|
|
25
|
-
],
|
|
26
|
-
'ts/no-for-in-array': 'error',
|
|
27
|
-
'ts/no-misused-promises': 'error',
|
|
28
|
-
'ts/no-misused-spread': 'error',
|
|
29
|
-
'ts/no-unnecessary-type-assertion': 'error',
|
|
30
|
-
'ts/promise-function-async': 'error',
|
|
31
|
-
'ts/require-await': 'off',
|
|
32
|
-
'ts/return-await': [
|
|
33
|
-
'error',
|
|
34
|
-
'always',
|
|
35
|
-
],
|
|
36
|
-
'ts/switch-exhaustiveness-check': [
|
|
37
|
-
'error',
|
|
38
|
-
{ considerDefaultExhaustiveForUnions: true },
|
|
39
|
-
],
|
|
40
|
-
},
|
|
41
|
-
};
|
|
42
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|