From 9326e1073695cf7a29bcc8d8b570fb6913d62787 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Sat, 30 Sep 2023 16:21:26 +0800 Subject: [PATCH] feat: update stylistic plugins --- eslint.config.js | 10 + fixtures/output/no-style/typescript.ts | 2 +- fixtures/output/no-style/vue-ts.vue | 4 +- fixtures/output/no-style/vue.vue | 4 +- package.json | 11 +- pnpm-lock.yaml | 255 +++++++++---------------- src/configs/javascript.ts | 21 +- src/configs/markdown.ts | 2 +- src/configs/stylistic.ts | 18 +- src/configs/typescript.ts | 2 - 10 files changed, 136 insertions(+), 193 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index 4e889c72dd..5c7c366f33 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -1,4 +1,5 @@ import sortKeys from 'eslint-plugin-sort-keys' +import styleMigrate from '@stylistic/eslint-plugin-migrate' import antfu from './dist/index.js' export default antfu( @@ -20,4 +21,13 @@ export default antfu( 'sort-keys/sort-keys-fix': 'error', }, }, + { + files: ['src/configs/*.ts'], + plugins: { + 'style-migrate': styleMigrate, + }, + rules: { + 'style-migrate/migrate': ['error', { namespaceTo: 'style' }], + }, + }, ) diff --git a/fixtures/output/no-style/typescript.ts b/fixtures/output/no-style/typescript.ts index 469feebbf2..dd22d789f7 100644 --- a/fixtures/output/no-style/typescript.ts +++ b/fixtures/output/no-style/typescript.ts @@ -72,7 +72,7 @@ class Dog extends Animal { const dog = new Dog('Buddy'); dog.bark(); -function fn (): string { +const fn = (): string => { return `hello${ 1}` } diff --git a/fixtures/output/no-style/vue-ts.vue b/fixtures/output/no-style/vue-ts.vue index 55c7bc0928..a0e64c574a 100644 --- a/fixtures/output/no-style/vue-ts.vue +++ b/fixtures/output/no-style/vue-ts.vue @@ -6,9 +6,9 @@ const greeting = ref('Hello, Vue 3!'); const counter = ref(0); // Define a function -function incrementCounter () { +const incrementCounter = () => { counter.value++; -} +};