Skip to content

Commit

Permalink
feat: update names for all config items
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Apr 2, 2024
1 parent c13d267 commit 9de13a1
Show file tree
Hide file tree
Showing 26 changed files with 73 additions and 64 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ export default antfu()
)
// overrides any named configs
.override(
'antfu:imports',
'antfu/imports',
{
rules: {
'import/order': ['error', { 'newlines-between': 'always' }],
Expand Down
9 changes: 7 additions & 2 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,18 @@ const antfu = jiti('./src').default
export default antfu(
{
vue: true,
// react: true,
react: true,
svelte: true,
astro: true,
typescript: true,

formatters: true,
},
{
ignores: [
'fixtures',
'_fixtures',
],
formatters: true,
},
{
files: ['src/**/*.ts'],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
"@stylistic/eslint-plugin": "^1.7.0",
"@typescript-eslint/eslint-plugin": "^7.5.0",
"@typescript-eslint/parser": "^7.5.0",
"eslint-config-flat-gitignore": "^0.1.3",
"eslint-config-flat-gitignore": "^0.1.5",
"eslint-flat-config-utils": "^0.2.0",
"eslint-merge-processors": "^0.1.0",
"eslint-plugin-antfu": "^2.1.2",
Expand Down
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/configs/astro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export async function astro(

return [
{
name: 'antfu:astro:setup',
name: 'antfu/astro/setup',
plugins: {
astro: pluginAstro,
},
Expand All @@ -37,7 +37,7 @@ export async function astro(
parser: parserTs as any,
},
},
name: 'antfu:astro:rules',
name: 'antfu/astro/rules',
rules: {
'astro/no-set-html-directive': 'off',
'astro/semi': 'off',
Expand Down
2 changes: 1 addition & 1 deletion src/configs/comments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { pluginComments } from '../plugins'
export async function comments(): Promise<TypedFlatConfigItem[]> {
return [
{
name: 'antfu:eslint-comments',
name: 'antfu/eslint-comments/rules',
plugins: {
'eslint-comments': pluginComments,
},
Expand Down
18 changes: 9 additions & 9 deletions src/configs/formatters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export async function formatters(

const configs: TypedFlatConfigItem[] = [
{
name: 'antfu:formatter:setup',
name: 'antfu/formatter/setup',
plugins: {
format: pluginFormat,
},
Expand All @@ -77,7 +77,7 @@ export async function formatters(
languageOptions: {
parser: parserPlain,
},
name: 'antfu:formatter:css',
name: 'antfu/formatter/css',
rules: {
'format/prettier': [
'error',
Expand All @@ -93,7 +93,7 @@ export async function formatters(
languageOptions: {
parser: parserPlain,
},
name: 'antfu:formatter:scss',
name: 'antfu/formatter/scss',
rules: {
'format/prettier': [
'error',
Expand All @@ -109,7 +109,7 @@ export async function formatters(
languageOptions: {
parser: parserPlain,
},
name: 'antfu:formatter:less',
name: 'antfu/formatter/less',
rules: {
'format/prettier': [
'error',
Expand All @@ -129,7 +129,7 @@ export async function formatters(
languageOptions: {
parser: parserPlain,
},
name: 'antfu:formatter:html',
name: 'antfu/formatter/html',
rules: {
'format/prettier': [
'error',
Expand Down Expand Up @@ -159,7 +159,7 @@ export async function formatters(
languageOptions: {
parser: parserPlain,
},
name: 'antfu:formatter:markdown',
name: 'antfu/formatter/markdown',
rules: {
[`format/${formater}`]: [
'error',
Expand All @@ -184,7 +184,7 @@ export async function formatters(
languageOptions: {
parser: parserPlain,
},
name: 'antfu:formatter:slidev',
name: 'antfu/formatter/slidev',
rules: {
'format/prettier': [
'error',
Expand All @@ -209,7 +209,7 @@ export async function formatters(
languageOptions: {
parser: parserPlain,
},
name: 'antfu:formatter:astro',
name: 'antfu/formatter/astro',
rules: {
'format/prettier': [
'error',
Expand All @@ -231,7 +231,7 @@ export async function formatters(
languageOptions: {
parser: parserPlain,
},
name: 'antfu:formatter:graphql',
name: 'antfu/formatter/graphql',
rules: {
'format/prettier': [
'error',
Expand Down
2 changes: 2 additions & 0 deletions src/configs/ignores.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ export async function ignores(): Promise<TypedFlatConfigItem[]> {
return [
{
ignores: GLOB_EXCLUDE,
// Awaits https://github.com/humanwhocodes/config-array/pull/131
// name: 'antfu/ignores',
},
]
}
4 changes: 2 additions & 2 deletions src/configs/imports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export async function imports(options: OptionsStylistic = {}): Promise<TypedFlat

return [
{
name: 'antfu:imports',
name: 'antfu/imports/rules',
plugins: {
antfu: pluginAntfu,
import: pluginImport,
Expand All @@ -36,7 +36,7 @@ export async function imports(options: OptionsStylistic = {}): Promise<TypedFlat
},
{
files: ['**/bin/**/*', `**/bin.${GLOB_SRC_EXT}`],
name: 'antfu:disables:imports-bin',
name: 'antfu/imports/disables/bin',
rules: {
'antfu/no-import-dist': 'off',
'antfu/no-import-node-modules-by-path': 'off',
Expand Down
4 changes: 2 additions & 2 deletions src/configs/javascript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export async function javascript(
linterOptions: {
reportUnusedDisableDirectives: true,
},
name: 'antfu:javascript',
name: 'antfu/javascript/rules',
plugins: {
'antfu': pluginAntfu,
'unused-imports': pluginUnusedImports,
Expand Down Expand Up @@ -216,7 +216,7 @@ export async function javascript(
},
{
files: [`scripts/${GLOB_SRC}`, `cli.${GLOB_SRC_EXT}`],
name: 'antfu:disables:cli',
name: 'antfu/javascript/disables/cli',
rules: {
'no-console': 'off',
},
Expand Down
2 changes: 1 addition & 1 deletion src/configs/jsdoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export async function jsdoc(options: OptionsStylistic = {}): Promise<TypedFlatCo

return [
{
name: 'antfu:jsdoc',
name: 'antfu/jsdoc/rules',
plugins: {
jsdoc: await interopDefault(import('eslint-plugin-jsdoc')),
},
Expand Down
4 changes: 2 additions & 2 deletions src/configs/jsonc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export async function jsonc(

return [
{
name: 'antfu:jsonc:setup',
name: 'antfu/jsonc/setup',
plugins: {
jsonc: pluginJsonc as any,
},
Expand All @@ -35,7 +35,7 @@ export async function jsonc(
languageOptions: {
parser: parserJsonc,
},
name: 'antfu:jsonc:rules',
name: 'antfu/jsonc/rules',
rules: {
'jsonc/no-bigint-literals': 'error',
'jsonc/no-binary-expression': 'error',
Expand Down
8 changes: 4 additions & 4 deletions src/configs/markdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ export async function markdown(

return [
{
name: 'antfu:markdown:setup',
name: 'antfu/markdown/setup',
plugins: {
markdown,
},
},
{
files,
ignores: [GLOB_MARKDOWN_IN_MARKDOWN],
name: 'antfu:markdown:processor',
name: 'antfu/markdown/processor',
// `eslint-plugin-markdown` only creates virtual files for code blocks,
// but not the markdown file itself. We use `eslint-merge-processors` to
// add a pass-through processor for the markdown file itself.
Expand All @@ -39,7 +39,7 @@ export async function markdown(
languageOptions: {
parser: parserPlain,
},
name: 'antfu:markdown:parser',
name: 'antfu/markdown/parser',
},
{
files: [
Expand All @@ -53,7 +53,7 @@ export async function markdown(
},
},
},
name: 'antfu:markdown:disables',
name: 'antfu/markdown/disables',
rules: {
'import/newline-after-import': 'off',

Expand Down
2 changes: 1 addition & 1 deletion src/configs/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { pluginNode } from '../plugins'
export async function node(): Promise<TypedFlatConfigItem[]> {
return [
{
name: 'antfu:node',
name: 'antfu/node/rules',
plugins: {
node: pluginNode,
},
Expand Down
2 changes: 1 addition & 1 deletion src/configs/perfectionist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { pluginPerfectionist } from '../plugins'
export async function perfectionist(): Promise<TypedFlatConfigItem[]> {
return [
{
name: 'antfu:perfectionist',
name: 'antfu/perfectionist/setup',
plugins: {
perfectionist: pluginPerfectionist,
},
Expand Down
4 changes: 2 additions & 2 deletions src/configs/react.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export async function react(

return [
{
name: 'antfu:react:setup',
name: 'antfu/react/setup',
plugins: {
'react': pluginReact,
'react-hooks': pluginReactHooks,
Expand All @@ -60,7 +60,7 @@ export async function react(
},
},
},
name: 'antfu:react:rules',
name: 'antfu/react/rules',
rules: {
// recommended rules react-hooks
'react-hooks/exhaustive-deps': 'warn',
Expand Down
4 changes: 2 additions & 2 deletions src/configs/sort.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export async function sortPackageJson(): Promise<TypedFlatConfigItem[]> {
return [
{
files: ['**/package.json'],
name: 'antfu:sort:package-json',
name: 'antfu/sort/package-json',
rules: {
'jsonc/sort-array-values': [
'error',
Expand Down Expand Up @@ -116,7 +116,7 @@ export function sortTsconfig(): TypedFlatConfigItem[] {
return [
{
files: ['**/tsconfig.json', '**/tsconfig.*.json'],
name: 'antfu:sort:tsconfig',
name: 'antfu/sort/tsconfig-json',
rules: {
'jsonc/sort-keys': [
'error',
Expand Down
2 changes: 1 addition & 1 deletion src/configs/stylistic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export async function stylistic(

return [
{
name: 'antfu:stylistic',
name: 'antfu/stylistic/rules',
plugins: {
antfu: pluginAntfu,
style: pluginStylistic,
Expand Down
4 changes: 2 additions & 2 deletions src/configs/svelte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export async function svelte(

return [
{
name: 'antfu:svelte:setup',
name: 'antfu/svelte/setup',
plugins: {
svelte: pluginSvelte,
},
Expand All @@ -46,7 +46,7 @@ export async function svelte(
: null,
},
},
name: 'antfu:svelte:rules',
name: 'antfu/svelte/rules',
processor: pluginSvelte.processors['.svelte'],
rules: {
'import/no-mutable-exports': 'off',
Expand Down
4 changes: 2 additions & 2 deletions src/configs/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export async function test(

return [
{
name: 'antfu:test:setup',
name: 'antfu/test/setup',
plugins: {
test: {
...pluginVitest,
Expand All @@ -36,7 +36,7 @@ export async function test(
},
{
files,
name: 'antfu:test:rules',
name: 'antfu/test/rules',
rules: {
'node/prefer-global/process': 'off',

Expand Down
4 changes: 2 additions & 2 deletions src/configs/toml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export async function toml(

return [
{
name: 'antfu:toml:setup',
name: 'antfu/toml/setup',
plugins: {
toml: pluginToml,
},
Expand All @@ -35,7 +35,7 @@ export async function toml(
languageOptions: {
parser: parserToml,
},
name: 'antfu:toml:rules',
name: 'antfu/toml/rules',
rules: {
'style/spaced-comment': 'off',

Expand Down
Loading

0 comments on commit 9de13a1

Please sign in to comment.