Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

breaking: replace deprecated stylistic rules #34

Merged
merged 1 commit into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/unlucky-lobsters-train.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@sveltejs/eslint-config": major
---

breaking: replace deprecated stylistic rules
18 changes: 10 additions & 8 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import ts from 'typescript-eslint';
import svelte from 'eslint-plugin-svelte';
import prettier from 'eslint-config-prettier';
import unicorn from 'eslint-plugin-unicorn';
import stylistic from '@stylistic/eslint-plugin-js';
import globals from 'globals';

/** @type {import('eslint').Linter.FlatConfig[]} */
Expand All @@ -14,7 +15,8 @@ export default [
...svelte.configs['flat/prettier'],
{
plugins: {
unicorn
unicorn,
'@stylistic': stylistic
},
languageOptions: {
globals: {
Expand All @@ -23,7 +25,9 @@ export default [
}
},
rules: {
'@typescript-eslint/array-type': [ 'error', { default: 'array-simple' } ],
'@stylistic/quote-props': ['error', 'as-needed'],
'@stylistic/quotes': ['error', 'single', { avoidEscape: true }],
'@typescript-eslint/array-type': ['error', { default: 'array-simple' }],
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/camelcase': 'off',
Expand All @@ -36,25 +40,23 @@ export default [
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-inferrable-types': 'off',
'@typescript-eslint/no-object-literal-type-assertion': 'off',
'@typescript-eslint/no-this-alias': 'off',
'@typescript-eslint/no-unused-vars': ['error', { args: 'after-used', argsIgnorePattern: '^_' }],
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-this-alias': 'off',
'@typescript-eslint/prefer-interface': 'off',
'no-constant-condition': ['error', { checkLoops: false }],
'no-duplicate-imports': 'error',
'no-empty': ['error', { allowEmptyCatch: true }],
'no-inner-declarations': 'off',
'no-sparse-arrays': 'off',
'no-restricted-properties': [
'error',
{ object: 'test', property: 'only', message: 'Do not check in test.only tests.' }
],
'no-sparse-arrays': 'off',
'prefer-const': ['error', { destructuring: 'all' }],
'no-var': 'error',
'object-shorthand': [ 'error', 'always' ],
'object-shorthand': ['error', 'always'],
'prefer-arrow-callback': 'error',
'prefer-const': [ 'error', { destructuring: 'all' } ],
quotes: ['error', 'single', { avoidEscape: true }],
'quote-props': [ 'error', 'as-needed' ],
'svelte/no-inner-declarations': 'off',
'unicorn/prefer-node-protocol': 'error'
}
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"homepage": "https://github.com/svelte/eslint-config#readme",
"devDependencies": {
"@changesets/cli": "^2.27.1",
"@stylistic/eslint-plugin-js": "^1.7.0",
"@svitejs/changesets-changelog-github-compact": "^1.1.0",
"eslint": "^9.0.0",
"eslint-config-prettier": "^9.1.0",
Expand All @@ -32,6 +33,7 @@
"typescript-eslint": "^7.6.0"
},
"peerDependencies": {
"@stylistic/eslint-plugin-js": ">= 1",
"eslint": ">= 9",
"eslint-config-prettier": ">= 9",
"eslint-plugin-svelte": ">= 2.36",
Expand Down
24 changes: 24 additions & 0 deletions pnpm-lock.yaml

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