Skip to content

Commit

Permalink
chore: Switch default ESLint plugin from eslint-plugin-svelte3 to `…
Browse files Browse the repository at this point in the history
…eslint-plugin-svelte` (#9749)

close: #9342
close: #6847

---------

Co-authored-by: Yosuke Ota <otameshiyo23@gmail.com>
Co-authored-by: Conduitry <git@chor.date>
Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>
  • Loading branch information
4 people authored Apr 25, 2023
1 parent d0efa15 commit e46e669
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 28 deletions.
5 changes: 5 additions & 0 deletions .changeset/curly-moons-sin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'create-svelte': major
---

feat: switch default ESLint plugin from `eslint-plugin-svelte3` to `eslint-plugin-svelte`
2 changes: 1 addition & 1 deletion packages/create-svelte/bin.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ if (options.types === 'typescript') {

if (options.features.includes('eslint')) {
console.log(bold('✔ ESLint'));
console.log(cyan(' https://github.com/sveltejs/eslint-plugin-svelte3\n'));
console.log(cyan(' https://github.com/sveltejs/eslint-plugin-svelte\n'));
}

if (options.features.includes('prettier')) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,31 @@
module.exports = {
root: true,
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:svelte/recommended',
'prettier'
],
parser: '@typescript-eslint/parser',
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'],
plugins: ['svelte3', '@typescript-eslint'],
plugins: ['@typescript-eslint'],
ignorePatterns: ['*.cjs'],
overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }],
settings: {
'svelte3/typescript': () => require('typescript')
},
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020
ecmaVersion: 2020,
extraFileExtensions: ['.svelte']
},
env: {
browser: true,
es2017: true,
node: true
}
},
overrides: [
{
files: ['*.svelte'],
parser: 'svelte-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser'
}
}
]
};
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
module.exports = {
root: true,
extends: ['eslint:recommended', 'prettier'],
plugins: ['svelte3'],
overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }],
extends: ['eslint:recommended', 'plugin:svelte/recommended', 'prettier'],
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020
ecmaVersion: 2020,
extraFileExtensions: ['.svelte']
},
env: {
browser: true,
Expand Down
26 changes: 18 additions & 8 deletions packages/create-svelte/shared/+eslint+typescript/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,20 +1,30 @@
module.exports = {
root: true,
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:svelte/recommended'
],
parser: '@typescript-eslint/parser',
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
plugins: ['svelte3', '@typescript-eslint'],
plugins: ['@typescript-eslint'],
ignorePatterns: ['*.cjs'],
overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }],
settings: {
'svelte3/typescript': () => require('typescript')
},
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020
ecmaVersion: 2020,
extraFileExtensions: ['.svelte']
},
env: {
browser: true,
es2017: true,
node: true
}
},
overrides: [
{
files: ['*.svelte'],
parser: 'svelte-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser'
}
}
]
};
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
module.exports = {
root: true,
extends: ['eslint:recommended'],
plugins: ['svelte3'],
overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }],
extends: ['eslint:recommended', 'plugin:svelte/recommended'],
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020
ecmaVersion: 2020,
extraFileExtensions: ['.svelte']
},
env: {
browser: true,
Expand Down
2 changes: 1 addition & 1 deletion packages/create-svelte/shared/+eslint/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"devDependencies": {
"eslint": "^8.28.0",
"eslint-plugin-svelte3": "^4.0.0"
"eslint-plugin-svelte": "^2.26.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@
<a class="how-to-play" href="/sverdle/how-to-play">How to play</a>

<div class="grid" class:playing={!won} class:bad-guess={form?.badGuess}>
{#each Array(6) as _, row}
{#each Array.from(Array(6).keys()) as row (row)}
{@const current = row === i}
<h2 class="visually-hidden">Row {row + 1}</h2>
<div class="row" class:current>
{#each Array(5) as _, column}
{#each Array.from(Array(5).keys()) as column (column)}
{@const answer = data.answers[row]?.[column]}
{@const value = data.guesses[row]?.[column] ?? ''}
{@const selected = current && column === data.guesses[row].length}
Expand Down

0 comments on commit e46e669

Please sign in to comment.