-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support eslint v9 flat config in plugin (#20)
* feat: create new flat and update old config scripts * chore: generate config file * chore: module exports * docs: update started docs * docs: update rule docs * chore: add module sourcetype for md files * feat: update docs script * Create rich-peaches-punch.md --------- Co-authored-by: Yosuke Ota <[email protected]>
- Loading branch information
Showing
15 changed files
with
196 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@intlify/eslint-plugin-svelte": minor | ||
--- | ||
|
||
feat: support eslint v9 flat config in plugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** DON'T EDIT THIS FILE; was created by scripts. */ | ||
export = [ | ||
{ | ||
name: '@intlify/vue-i18n:base:setup', | ||
plugins: { | ||
get '@intlify/svelte'() { | ||
return require('../../index') | ||
} | ||
} | ||
}, | ||
{ | ||
name: '@intlify/svelte:base:svelte', | ||
files: ['*.svelte'], | ||
languageOptions: { | ||
parser: require('svelte-eslint-parser') | ||
} | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/** DON'T EDIT THIS FILE; was created by scripts. */ | ||
import config from './base' | ||
export = [ | ||
...config, | ||
{ | ||
name: '@intlify/svelte:recommended:setup', | ||
languageOptions: { | ||
ecmaVersion: 2018, | ||
sourceType: 'module', | ||
parserOptions: { | ||
ecmaFeatures: { | ||
jsx: true | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
name: '@intlify/svelte:recommended:rules', | ||
rules: { | ||
'@intlify/svelte/no-raw-text': 'warn' | ||
} | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { resolve } from 'path' | ||
import { writeAndFormat } from './lib/write' | ||
|
||
writeAndFormat( | ||
//base.ts | ||
resolve(__dirname, '../lib/configs/flat/base.ts'), | ||
`/** DON'T EDIT THIS FILE; was created by scripts. */ | ||
export = [ | ||
{ | ||
name: @intlify/svelte:base:setup', | ||
plugins: { | ||
get '@intlify/svelte'() { | ||
return require('../../index') | ||
} | ||
} | ||
}, | ||
{ | ||
name: "@intlify/svelte:base:svelte", | ||
files: ['*.svelte'], | ||
languageOptions: { | ||
parser: require('svelte-eslint-parser'), | ||
} | ||
}, | ||
]` | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { resolve } from 'path' | ||
import rules from './lib/rules' | ||
import { writeAndFormat } from './lib/write' | ||
|
||
// flat/recommended.ts | ||
writeAndFormat( | ||
resolve(__dirname, '../lib/configs/flat/recommended.ts'), | ||
`/** DON'T EDIT THIS FILE; was created by scripts. */ | ||
import config from './base'; | ||
export = [ | ||
...config, | ||
{ | ||
name: '@intlify/svelte:recommended:setup', | ||
languageOptions: { | ||
ecmaVersion: 2018, | ||
sourceType: 'module', | ||
parserOptions: { | ||
ecmaFeatures: { | ||
jsx: true | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
name: '@intlify/svelte:recommended:rules', | ||
rules: { | ||
${rules | ||
.filter(rule => rule.recommended) | ||
.map(rule => `'${rule.id}': 'warn',`) | ||
.join('\n ')} | ||
}, | ||
} | ||
]` | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters