Skip to content

Commit

Permalink
disabled config for svelte
Browse files Browse the repository at this point in the history
  • Loading branch information
MP281X committed Jun 20, 2024
1 parent 60280c3 commit c4441b7
Show file tree
Hide file tree
Showing 4 changed files with 332 additions and 437 deletions.
48 changes: 24 additions & 24 deletions configs/eslint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import unicorn from 'eslint-plugin-unicorn'
// @ts-expect-error: no type definitions
import perfectionist from 'eslint-plugin-perfectionist'

import svelte from 'eslint-plugin-svelte'
import svelteParser from 'svelte-eslint-parser'
// import svelte from 'eslint-plugin-svelte'
// import svelteParser from 'svelte-eslint-parser'

import astro from 'eslint-plugin-astro'

Expand Down Expand Up @@ -301,28 +301,28 @@ export default ts.config(
}),

// svelte
conditionalConfig('svelte', {
extends: svelte.configs['flat/recommended'] as any,
files: ['**/*.svelte'],
languageOptions: { parser: svelteParser, parserOptions: { extraFileExtensions: ['.svelte'], parser: ts.parser } },
rules: {
// eslint-disable-next-line unicorn/no-null
'svelte/block-lang': ['error', { enforceScriptPresent: true, script: ['ts'], style: ['postcss', null] }], // require lang="ts" in the script tag
'svelte/infinite-reactive-loop': 'error', // prevent reactivity bug
'svelte/no-export-load-in-svelte-module-in-kit-pages': 'error', // no function called load in script
'svelte/no-immutable-reactive-statements': 'error', // disable reactive statement for const values
'svelte/no-reactive-reassign': 'error', // don't readding derived reactive values
'svelte/no-store-async': 'error', // disable async await in stores
'svelte/no-useless-mustaches': 'error', // don't allow useless {}
'svelte/sort-attributes': 'off', // already checked by the "perfectionist" plugin
'svelte/valid-prop-names-in-kit-pages': 'error', // disable invalid exports in +page.svelte file

// rules that doesn't work in svelte 5
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off'
}
}),
// conditionalConfig('svelte', {
// extends: svelte.configs['flat/recommended'] as any,
// files: ['**/*.svelte'],
// languageOptions: { parser: svelteParser, parserOptions: { extraFileExtensions: ['.svelte'], parser: ts.parser } },
// rules: {
// // eslint-disable-next-line unicorn/no-null
// 'svelte/block-lang': ['error', { enforceScriptPresent: true, script: ['ts'], style: ['postcss', null] }], // require lang="ts" in the script tag
// 'svelte/infinite-reactive-loop': 'error', // prevent reactivity bug
// 'svelte/no-export-load-in-svelte-module-in-kit-pages': 'error', // no function called load in script
// 'svelte/no-immutable-reactive-statements': 'error', // disable reactive statement for const values
// 'svelte/no-reactive-reassign': 'error', // don't readding derived reactive values
// 'svelte/no-store-async': 'error', // disable async await in stores
// 'svelte/no-useless-mustaches': 'error', // don't allow useless {}
// 'svelte/sort-attributes': 'off', // already checked by the "perfectionist" plugin
// 'svelte/valid-prop-names-in-kit-pages': 'error', // disable invalid exports in +page.svelte file
//
// // rules that doesn't work in svelte 5
// '@typescript-eslint/no-unsafe-assignment': 'off',
// '@typescript-eslint/no-unsafe-call': 'off',
// '@typescript-eslint/no-unsafe-member-access': 'off'
// }
// }),

// astro
conditionalConfig('astro', {
Expand Down
2 changes: 1 addition & 1 deletion configs/prettier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
arrowParens: 'avoid',
experimentalTernaries: true,
overrides: [{ files: '*.json', options: { parser: 'jsonc' } }],
plugins: ['prettier-plugin-svelte', 'prettier-plugin-tailwindcss', 'prettier-plugin-astro'],
plugins: ['prettier-plugin-tailwindcss', 'prettier-plugin-astro'],
printWidth: 150,
quoteProps: 'consistent',
semi: false,
Expand Down
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
"dependencies": {
"@fsouza/prettierd": "latest",
"prettier-plugin-astro": "^0",
"prettier-plugin-svelte": "^3",
"prettier-plugin-tailwindcss": "^0",

"eslint": "^9",
Expand All @@ -42,7 +41,6 @@
"eslint-plugin-astro": "^1",
"eslint-plugin-react": "^7",
"eslint-plugin-solid": "^0",
"eslint-plugin-svelte": "^2",
"eslint-plugin-unicorn": "^53",
"eslint-config-prettier": "^9",
"@next/eslint-plugin-next": "rc",
Expand Down
Loading

0 comments on commit c4441b7

Please sign in to comment.