forked from beyonk-group/eslint-config
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from jrmajor/eslint-9
breaking: require eslint v9 and switch to flat config
- Loading branch information
Showing
5 changed files
with
1,123 additions
and
730 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 @@ | ||
--- | ||
"@sveltejs/eslint-config": major | ||
--- | ||
|
||
breaking: require eslint v9 and switch to flat config |
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 |
---|---|---|
@@ -1,59 +1,62 @@ | ||
'use strict'; | ||
import js from '@eslint/js'; | ||
import ts from 'typescript-eslint'; | ||
import svelte from 'eslint-plugin-svelte'; | ||
import prettier from 'eslint-config-prettier'; | ||
import unicorn from 'eslint-plugin-unicorn'; | ||
import globals from 'globals'; | ||
|
||
module.exports = { | ||
rules: { | ||
'@typescript-eslint/array-type': [ 'error', { default: 'array-simple' } ], | ||
'@typescript-eslint/ban-ts-comment': 'off', | ||
'@typescript-eslint/ban-types': 'off', | ||
'@typescript-eslint/camelcase': 'off', | ||
'@typescript-eslint/class-name-casing': 'off', | ||
'@typescript-eslint/explicit-function-return-type': 'off', | ||
'@typescript-eslint/explicit-member-accessibility': 'off', | ||
'@typescript-eslint/explicit-module-boundary-types': 'off', | ||
'@typescript-eslint/naming-convention': 'off', | ||
'@typescript-eslint/no-empty-function': 'off', | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
'@typescript-eslint/no-inferrable-types': 'off', | ||
'@typescript-eslint/no-object-literal-type-assertion': '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-var': 'error', | ||
'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' | ||
}, | ||
globals: { | ||
globalThis: false | ||
}, | ||
env: { | ||
es6: true, | ||
browser: true, | ||
node: true | ||
}, | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:svelte/recommended', | ||
'prettier' | ||
], | ||
parserOptions: { | ||
ecmaVersion: 13, // es2022 | ||
sourceType: 'module' | ||
}, | ||
plugins: ['unicorn'] | ||
}; | ||
/** @type {import('eslint').Linter.FlatConfig[]} */ | ||
export default [ | ||
js.configs.recommended, | ||
...ts.configs.recommended, | ||
...svelte.configs['flat/recommended'], | ||
prettier, | ||
...svelte.configs['flat/prettier'], | ||
{ | ||
plugins: { | ||
unicorn | ||
}, | ||
languageOptions: { | ||
globals: { | ||
...globals.browser, | ||
...globals.node | ||
} | ||
}, | ||
rules: { | ||
'@typescript-eslint/array-type': [ 'error', { default: 'array-simple' } ], | ||
'@typescript-eslint/ban-ts-comment': 'off', | ||
'@typescript-eslint/ban-types': 'off', | ||
'@typescript-eslint/camelcase': 'off', | ||
'@typescript-eslint/class-name-casing': 'off', | ||
'@typescript-eslint/explicit-function-return-type': 'off', | ||
'@typescript-eslint/explicit-member-accessibility': 'off', | ||
'@typescript-eslint/explicit-module-boundary-types': 'off', | ||
'@typescript-eslint/naming-convention': 'off', | ||
'@typescript-eslint/no-empty-function': 'off', | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
'@typescript-eslint/no-inferrable-types': 'off', | ||
'@typescript-eslint/no-object-literal-type-assertion': '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-var': 'error', | ||
'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' | ||
} | ||
} | ||
]; |
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 |
---|---|---|
|
@@ -2,9 +2,10 @@ | |
"name": "@sveltejs/eslint-config", | ||
"version": "6.0.4", | ||
"description": "Svelte ESLint config", | ||
"type": "module", | ||
"main": "index.js", | ||
"scripts": { | ||
"lint": "eslint -c index.js .", | ||
"lint": "eslint -c index.js", | ||
"lint:ci": "eslint -c index.js --format junit -o reports/junit/eslint-results.xml", | ||
"release": "changeset publish" | ||
}, | ||
|
@@ -19,24 +20,25 @@ | |
"license": "MIT", | ||
"homepage": "https://github.com/svelte/eslint-config#readme", | ||
"devDependencies": { | ||
"@changesets/cli": "^2.27.1", | ||
"@svitejs/changesets-changelog-github-compact": "^1.1.0", | ||
"@typescript-eslint/eslint-plugin": "^5.59.6", | ||
"@typescript-eslint/parser": "^5.59.6", | ||
"@changesets/cli": "^2.26.1", | ||
"eslint": "^8.40.0", | ||
"eslint-config-prettier": "^8.8.0", | ||
"eslint-plugin-svelte": "^2.28.0", | ||
"eslint-plugin-unicorn": "^47.0.0", | ||
"typescript": "^5.0.4" | ||
"eslint": "^9.0.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-plugin-svelte": "^2.36.0", | ||
"eslint-plugin-unicorn": "^52.0.0", | ||
"globals": "^15.0.0", | ||
"svelte": "^4.2.12", | ||
"typescript": "^5.4.4", | ||
"typescript-eslint": "^7.6.0" | ||
}, | ||
"peerDependencies": { | ||
"@typescript-eslint/eslint-plugin": ">= 5", | ||
"@typescript-eslint/parser": ">= 5", | ||
"eslint": ">= 8", | ||
"eslint-config-prettier": ">= 8", | ||
"eslint-plugin-svelte": ">= 2", | ||
"eslint-plugin-unicorn": ">= 47", | ||
"typescript": ">= 4" | ||
"eslint": ">= 9", | ||
"eslint-config-prettier": ">= 9", | ||
"eslint-plugin-svelte": ">= 2.36", | ||
"eslint-plugin-unicorn": ">= 50", | ||
"globals": ">= 15", | ||
"typescript": ">= 5", | ||
"typescript-eslint": ">= 7.5" | ||
}, | ||
"packageManager": "[email protected]" | ||
} |
Oops, something went wrong.