Skip to content

Commit 9de13a1

Browse files
committedApr 2, 2024
feat: update names for all config items
1 parent c13d267 commit 9de13a1

26 files changed

+73
-64
lines changed
 

‎README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ export default antfu()
370370
)
371371
// overrides any named configs
372372
.override(
373-
'antfu:imports',
373+
'antfu/imports',
374374
{
375375
rules: {
376376
'import/order': ['error', { 'newlines-between': 'always' }],

‎eslint.config.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,18 @@ const antfu = jiti('./src').default
1111
export default antfu(
1212
{
1313
vue: true,
14-
// react: true,
14+
react: true,
15+
svelte: true,
16+
astro: true,
1517
typescript: true,
18+
19+
formatters: true,
20+
},
21+
{
1622
ignores: [
1723
'fixtures',
1824
'_fixtures',
1925
],
20-
formatters: true,
2126
},
2227
{
2328
files: ['src/**/*.ts'],

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
"@stylistic/eslint-plugin": "^1.7.0",
9393
"@typescript-eslint/eslint-plugin": "^7.5.0",
9494
"@typescript-eslint/parser": "^7.5.0",
95-
"eslint-config-flat-gitignore": "^0.1.3",
95+
"eslint-config-flat-gitignore": "^0.1.5",
9696
"eslint-flat-config-utils": "^0.2.0",
9797
"eslint-merge-processors": "^0.1.0",
9898
"eslint-plugin-antfu": "^2.1.2",

‎pnpm-lock.yaml

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/configs/astro.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export async function astro(
2323

2424
return [
2525
{
26-
name: 'antfu:astro:setup',
26+
name: 'antfu/astro/setup',
2727
plugins: {
2828
astro: pluginAstro,
2929
},
@@ -37,7 +37,7 @@ export async function astro(
3737
parser: parserTs as any,
3838
},
3939
},
40-
name: 'antfu:astro:rules',
40+
name: 'antfu/astro/rules',
4141
rules: {
4242
'astro/no-set-html-directive': 'off',
4343
'astro/semi': 'off',

‎src/configs/comments.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { pluginComments } from '../plugins'
44
export async function comments(): Promise<TypedFlatConfigItem[]> {
55
return [
66
{
7-
name: 'antfu:eslint-comments',
7+
name: 'antfu/eslint-comments/rules',
88
plugins: {
99
'eslint-comments': pluginComments,
1010
},

‎src/configs/formatters.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export async function formatters(
6363

6464
const configs: TypedFlatConfigItem[] = [
6565
{
66-
name: 'antfu:formatter:setup',
66+
name: 'antfu/formatter/setup',
6767
plugins: {
6868
format: pluginFormat,
6969
},
@@ -77,7 +77,7 @@ export async function formatters(
7777
languageOptions: {
7878
parser: parserPlain,
7979
},
80-
name: 'antfu:formatter:css',
80+
name: 'antfu/formatter/css',
8181
rules: {
8282
'format/prettier': [
8383
'error',
@@ -93,7 +93,7 @@ export async function formatters(
9393
languageOptions: {
9494
parser: parserPlain,
9595
},
96-
name: 'antfu:formatter:scss',
96+
name: 'antfu/formatter/scss',
9797
rules: {
9898
'format/prettier': [
9999
'error',
@@ -109,7 +109,7 @@ export async function formatters(
109109
languageOptions: {
110110
parser: parserPlain,
111111
},
112-
name: 'antfu:formatter:less',
112+
name: 'antfu/formatter/less',
113113
rules: {
114114
'format/prettier': [
115115
'error',
@@ -129,7 +129,7 @@ export async function formatters(
129129
languageOptions: {
130130
parser: parserPlain,
131131
},
132-
name: 'antfu:formatter:html',
132+
name: 'antfu/formatter/html',
133133
rules: {
134134
'format/prettier': [
135135
'error',
@@ -159,7 +159,7 @@ export async function formatters(
159159
languageOptions: {
160160
parser: parserPlain,
161161
},
162-
name: 'antfu:formatter:markdown',
162+
name: 'antfu/formatter/markdown',
163163
rules: {
164164
[`format/${formater}`]: [
165165
'error',
@@ -184,7 +184,7 @@ export async function formatters(
184184
languageOptions: {
185185
parser: parserPlain,
186186
},
187-
name: 'antfu:formatter:slidev',
187+
name: 'antfu/formatter/slidev',
188188
rules: {
189189
'format/prettier': [
190190
'error',
@@ -209,7 +209,7 @@ export async function formatters(
209209
languageOptions: {
210210
parser: parserPlain,
211211
},
212-
name: 'antfu:formatter:astro',
212+
name: 'antfu/formatter/astro',
213213
rules: {
214214
'format/prettier': [
215215
'error',
@@ -231,7 +231,7 @@ export async function formatters(
231231
languageOptions: {
232232
parser: parserPlain,
233233
},
234-
name: 'antfu:formatter:graphql',
234+
name: 'antfu/formatter/graphql',
235235
rules: {
236236
'format/prettier': [
237237
'error',

‎src/configs/ignores.ts

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ export async function ignores(): Promise<TypedFlatConfigItem[]> {
55
return [
66
{
77
ignores: GLOB_EXCLUDE,
8+
// Awaits https://github.com/humanwhocodes/config-array/pull/131
9+
// name: 'antfu/ignores',
810
},
911
]
1012
}

‎src/configs/imports.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export async function imports(options: OptionsStylistic = {}): Promise<TypedFlat
99

1010
return [
1111
{
12-
name: 'antfu:imports',
12+
name: 'antfu/imports/rules',
1313
plugins: {
1414
antfu: pluginAntfu,
1515
import: pluginImport,
@@ -36,7 +36,7 @@ export async function imports(options: OptionsStylistic = {}): Promise<TypedFlat
3636
},
3737
{
3838
files: ['**/bin/**/*', `**/bin.${GLOB_SRC_EXT}`],
39-
name: 'antfu:disables:imports-bin',
39+
name: 'antfu/imports/disables/bin',
4040
rules: {
4141
'antfu/no-import-dist': 'off',
4242
'antfu/no-import-node-modules-by-path': 'off',

‎src/configs/javascript.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export async function javascript(
3535
linterOptions: {
3636
reportUnusedDisableDirectives: true,
3737
},
38-
name: 'antfu:javascript',
38+
name: 'antfu/javascript/rules',
3939
plugins: {
4040
'antfu': pluginAntfu,
4141
'unused-imports': pluginUnusedImports,
@@ -216,7 +216,7 @@ export async function javascript(
216216
},
217217
{
218218
files: [`scripts/${GLOB_SRC}`, `cli.${GLOB_SRC_EXT}`],
219-
name: 'antfu:disables:cli',
219+
name: 'antfu/javascript/disables/cli',
220220
rules: {
221221
'no-console': 'off',
222222
},

‎src/configs/jsdoc.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export async function jsdoc(options: OptionsStylistic = {}): Promise<TypedFlatCo
88

99
return [
1010
{
11-
name: 'antfu:jsdoc',
11+
name: 'antfu/jsdoc/rules',
1212
plugins: {
1313
jsdoc: await interopDefault(import('eslint-plugin-jsdoc')),
1414
},

‎src/configs/jsonc.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export async function jsonc(
2525

2626
return [
2727
{
28-
name: 'antfu:jsonc:setup',
28+
name: 'antfu/jsonc/setup',
2929
plugins: {
3030
jsonc: pluginJsonc as any,
3131
},
@@ -35,7 +35,7 @@ export async function jsonc(
3535
languageOptions: {
3636
parser: parserJsonc,
3737
},
38-
name: 'antfu:jsonc:rules',
38+
name: 'antfu/jsonc/rules',
3939
rules: {
4040
'jsonc/no-bigint-literals': 'error',
4141
'jsonc/no-binary-expression': 'error',

‎src/configs/markdown.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ export async function markdown(
1717

1818
return [
1919
{
20-
name: 'antfu:markdown:setup',
20+
name: 'antfu/markdown/setup',
2121
plugins: {
2222
markdown,
2323
},
2424
},
2525
{
2626
files,
2727
ignores: [GLOB_MARKDOWN_IN_MARKDOWN],
28-
name: 'antfu:markdown:processor',
28+
name: 'antfu/markdown/processor',
2929
// `eslint-plugin-markdown` only creates virtual files for code blocks,
3030
// but not the markdown file itself. We use `eslint-merge-processors` to
3131
// add a pass-through processor for the markdown file itself.
@@ -39,7 +39,7 @@ export async function markdown(
3939
languageOptions: {
4040
parser: parserPlain,
4141
},
42-
name: 'antfu:markdown:parser',
42+
name: 'antfu/markdown/parser',
4343
},
4444
{
4545
files: [
@@ -53,7 +53,7 @@ export async function markdown(
5353
},
5454
},
5555
},
56-
name: 'antfu:markdown:disables',
56+
name: 'antfu/markdown/disables',
5757
rules: {
5858
'import/newline-after-import': 'off',
5959

‎src/configs/node.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { pluginNode } from '../plugins'
44
export async function node(): Promise<TypedFlatConfigItem[]> {
55
return [
66
{
7-
name: 'antfu:node',
7+
name: 'antfu/node/rules',
88
plugins: {
99
node: pluginNode,
1010
},

‎src/configs/perfectionist.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { pluginPerfectionist } from '../plugins'
99
export async function perfectionist(): Promise<TypedFlatConfigItem[]> {
1010
return [
1111
{
12-
name: 'antfu:perfectionist',
12+
name: 'antfu/perfectionist/setup',
1313
plugins: {
1414
perfectionist: pluginPerfectionist,
1515
},

‎src/configs/react.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export async function react(
3939

4040
return [
4141
{
42-
name: 'antfu:react:setup',
42+
name: 'antfu/react/setup',
4343
plugins: {
4444
'react': pluginReact,
4545
'react-hooks': pluginReactHooks,
@@ -60,7 +60,7 @@ export async function react(
6060
},
6161
},
6262
},
63-
name: 'antfu:react:rules',
63+
name: 'antfu/react/rules',
6464
rules: {
6565
// recommended rules react-hooks
6666
'react-hooks/exhaustive-deps': 'warn',

‎src/configs/sort.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export async function sortPackageJson(): Promise<TypedFlatConfigItem[]> {
99
return [
1010
{
1111
files: ['**/package.json'],
12-
name: 'antfu:sort:package-json',
12+
name: 'antfu/sort/package-json',
1313
rules: {
1414
'jsonc/sort-array-values': [
1515
'error',
@@ -116,7 +116,7 @@ export function sortTsconfig(): TypedFlatConfigItem[] {
116116
return [
117117
{
118118
files: ['**/tsconfig.json', '**/tsconfig.*.json'],
119-
name: 'antfu:sort:tsconfig',
119+
name: 'antfu/sort/tsconfig-json',
120120
rules: {
121121
'jsonc/sort-keys': [
122122
'error',

‎src/configs/stylistic.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export async function stylistic(
3636

3737
return [
3838
{
39-
name: 'antfu:stylistic',
39+
name: 'antfu/stylistic/rules',
4040
plugins: {
4141
antfu: pluginAntfu,
4242
style: pluginStylistic,

‎src/configs/svelte.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export async function svelte(
3030

3131
return [
3232
{
33-
name: 'antfu:svelte:setup',
33+
name: 'antfu/svelte/setup',
3434
plugins: {
3535
svelte: pluginSvelte,
3636
},
@@ -46,7 +46,7 @@ export async function svelte(
4646
: null,
4747
},
4848
},
49-
name: 'antfu:svelte:rules',
49+
name: 'antfu/svelte/rules',
5050
processor: pluginSvelte.processors['.svelte'],
5151
rules: {
5252
'import/no-mutable-exports': 'off',

‎src/configs/test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export async function test(
2222

2323
return [
2424
{
25-
name: 'antfu:test:setup',
25+
name: 'antfu/test/setup',
2626
plugins: {
2727
test: {
2828
...pluginVitest,
@@ -36,7 +36,7 @@ export async function test(
3636
},
3737
{
3838
files,
39-
name: 'antfu:test:rules',
39+
name: 'antfu/test/rules',
4040
rules: {
4141
'node/prefer-global/process': 'off',
4242

‎src/configs/toml.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export async function toml(
2525

2626
return [
2727
{
28-
name: 'antfu:toml:setup',
28+
name: 'antfu/toml/setup',
2929
plugins: {
3030
toml: pluginToml,
3131
},
@@ -35,7 +35,7 @@ export async function toml(
3535
languageOptions: {
3636
parser: parserToml,
3737
},
38-
name: 'antfu:toml:rules',
38+
name: 'antfu/toml/rules',
3939
rules: {
4040
'style/spaced-comment': 'off',
4141

‎src/configs/typescript.ts

+16-14
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,14 @@ export async function typescript(
7272
...parserOptions as any,
7373
},
7474
},
75-
name: `antfu:typescript:${typeAware ? 'type-aware-parser' : 'parser'}`,
75+
name: `antfu/typescript/${typeAware ? 'type-aware-parser' : 'parser'}`,
7676
}
7777
}
7878

7979
return [
8080
{
8181
// Install the plugins without globs, so they can be configured separately.
82-
name: 'antfu:typescript:setup',
82+
name: 'antfu/typescript/setup',
8383
plugins: {
8484
antfu: pluginAntfu,
8585
ts: pluginTs as any,
@@ -94,7 +94,7 @@ export async function typescript(
9494
: [makeParser(false, files)],
9595
{
9696
files,
97-
name: 'antfu:typescript:rules',
97+
name: 'antfu/typescript/rules',
9898
rules: {
9999
...renameRules(
100100
pluginTs.configs['eslint-recommended'].overrides![0].rules!,
@@ -133,17 +133,19 @@ export async function typescript(
133133
...overrides,
134134
},
135135
},
136-
{
137-
files: filesTypeAware,
138-
name: 'antfu:typescript:rules-type-aware',
139-
rules: {
140-
...tsconfigPath ? typeAwareRules : {},
141-
...overrides,
142-
},
143-
},
136+
...isTypeAware
137+
? [{
138+
files: filesTypeAware,
139+
name: 'antfu/typescript/rules-type-aware',
140+
rules: {
141+
...tsconfigPath ? typeAwareRules : {},
142+
...overrides,
143+
},
144+
}]
145+
: [],
144146
{
145147
files: ['**/*.d.ts'],
146-
name: 'antfu:typescript:dts-overrides',
148+
name: 'antfu/typescript/disables/dts',
147149
rules: {
148150
'eslint-comments/no-unlimited-disable': 'off',
149151
'import/no-duplicates': 'off',
@@ -153,14 +155,14 @@ export async function typescript(
153155
},
154156
{
155157
files: ['**/*.{test,spec}.ts?(x)'],
156-
name: 'antfu:typescript:tests-overrides',
158+
name: 'antfu/typescript/disables/test',
157159
rules: {
158160
'no-unused-expressions': 'off',
159161
},
160162
},
161163
{
162164
files: ['**/*.js', '**/*.cjs'],
163-
name: 'antfu:typescript:javascript-overrides',
165+
name: 'antfu/typescript/disables/cjs',
164166
rules: {
165167
'ts/no-require-imports': 'off',
166168
'ts/no-var-requires': 'off',

‎src/configs/unicorn.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { pluginUnicorn } from '../plugins'
44
export async function unicorn(): Promise<TypedFlatConfigItem[]> {
55
return [
66
{
7-
name: 'antfu:unicorn',
7+
name: 'antfu/unicorn/rules',
88
plugins: {
99
unicorn: pluginUnicorn,
1010
},

‎src/configs/unocss.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export async function unocss(
2121

2222
return [
2323
{
24-
name: 'antfu:unocss',
24+
name: 'antfu/unocss',
2525
plugins: {
2626
unocss: pluginUnoCSS,
2727
},

‎src/configs/vue.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export async function vue(
5454
watchEffect: 'readonly',
5555
},
5656
},
57-
name: 'antfu:vue:setup',
57+
name: 'antfu/vue/setup',
5858
plugins: {
5959
vue: pluginVue,
6060
},
@@ -74,7 +74,7 @@ export async function vue(
7474
sourceType: 'module',
7575
},
7676
},
77-
name: 'antfu:vue:rules',
77+
name: 'antfu/vue/rules',
7878
processor: sfcBlocks === false
7979
? pluginVue.processors['.vue']
8080
: mergeProcessors([

‎src/configs/yaml.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export async function yaml(
2626

2727
return [
2828
{
29-
name: 'antfu:yaml:setup',
29+
name: 'antfu/yaml/setup',
3030
plugins: {
3131
yaml: pluginYaml,
3232
},
@@ -36,7 +36,7 @@ export async function yaml(
3636
languageOptions: {
3737
parser: parserYaml,
3838
},
39-
name: 'antfu:yaml:rules',
39+
name: 'antfu/yaml/rules',
4040
rules: {
4141
'style/spaced-comment': 'off',
4242

0 commit comments

Comments
 (0)
Please sign in to comment.