-
-
Notifications
You must be signed in to change notification settings - Fork 115
chore(deps): update to eslint v9 #927
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
Merged
Merged
Changes from 10 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
7ab62a9
chore(deps): update to eslint v9
dominikg 4231500
wip: refactor to add svelte/eslint-config and remove compat layer
dominikg 3b7f564
fixes
dominikg 51bdce8
fix: ignore missing import that isn't needed if not built
dominikg d8c1b8f
remove things that have no effect or are defined in svelte_config alr…
dominikg fea5d38
fix: add missing peer for svelte eslint config
dominikg 2f1afcb
chore: remove empty lines
dominikg 42953e4
chore: cleanup eslint config
dominikg 62a425d
chore: reduce eslint config more
dominikg 5043f54
chore: update to latest svelte eslint setup
dominikg 9432777
chore: more explicit name for org config, remove declaration for mark…
dominikg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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,167 @@ | ||
import markdown from 'eslint-plugin-markdown'; | ||
import globals from 'globals'; | ||
import n from 'eslint-plugin-n'; | ||
import svelte_config from '@sveltejs/eslint-config'; | ||
import svelteParser from 'svelte-eslint-parser'; | ||
export default [ | ||
{ | ||
name: 'local/ignores', | ||
ignores: [ | ||
'**/temp/**', | ||
'**/dist/**', | ||
'**/build/**', | ||
'**/.svelte-kit/**', | ||
'**/.svelte/**', | ||
'packages/playground/big/src/pages/**', // lots of generated files | ||
'packages/*/types/index.d.ts', | ||
'packages/*/types/index.d.ts.map', | ||
'packages/*/CHANGELOG.md' | ||
] | ||
}, | ||
...svelte_config, // contains setup for svelte, typescript and unicorn | ||
n.configs['flat/recommended-module'], | ||
...markdown.configs.recommended, | ||
{ | ||
name: 'local/language-options', | ||
languageOptions: { | ||
ecmaVersion: 2022, | ||
sourceType: 'module' | ||
} | ||
}, | ||
{ | ||
name: 'local/generic-rules', | ||
rules: { | ||
'n/no-unsupported-features/es-builtins': 'error', | ||
'n/no-unsupported-features/es-syntax': 'error', | ||
'no-console': 'off', | ||
'no-debugger': 'error', | ||
|
||
'n/no-extraneous-import': [ | ||
'error', | ||
{ | ||
allowModules: ['vite', 'vitest'] | ||
} | ||
], | ||
|
||
'no-restricted-properties': [ | ||
'error', | ||
{ | ||
property: 'substr', | ||
message: 'Use .slice instead of .substr.' | ||
} | ||
], | ||
|
||
'n/no-unpublished-import': 'off', | ||
'n/no-unpublished-require': 'off', | ||
'no-process-exit': 'off', | ||
|
||
'prefer-const': [ | ||
'error', | ||
{ | ||
destructuring: 'all' | ||
} | ||
], | ||
|
||
quotes: [ | ||
'error', | ||
'single', | ||
{ | ||
avoidEscape: true | ||
} | ||
], | ||
|
||
'unicorn/prefer-node-protocol': 'error' | ||
} | ||
}, | ||
{ | ||
name: 'local/packages-src', | ||
files: ['packages/*/src/**'], | ||
rules: { | ||
'no-console': 'error' | ||
} | ||
}, | ||
{ | ||
name: 'local/inspector-extras', | ||
files: [ | ||
'packages/vite-plugin-svelte-inspector/src/runtime/load-inspector.js', | ||
'packages/vite-plugin-svelte-inspector/src/runtime/Inspector.svelte' | ||
], | ||
|
||
languageOptions: { | ||
globals: { | ||
...globals.browser | ||
} | ||
}, | ||
rules: { | ||
'n/no-unsupported-features/node-builtins': 'off' | ||
} | ||
}, | ||
{ | ||
name: 'local/tests-and-playground-rules', | ||
files: ['packages/e2e-tests/**', 'packages/playground/**'], | ||
|
||
rules: { | ||
'n/no-extraneous-import': 'off' | ||
} | ||
}, | ||
{ | ||
name: 'local/svelte-files', | ||
files: ['**/*.svelte'], | ||
|
||
languageOptions: { | ||
globals: { | ||
...globals.browser | ||
}, | ||
parserOptions: { | ||
parser: '@typescript-eslint/parser' | ||
} | ||
}, | ||
|
||
rules: { | ||
'n/no-missing-import': 'off' // n doesn't know some vite specifics or monorepo imports. | ||
} | ||
}, | ||
{ | ||
name: 'local/svelte-runes-globals', | ||
files: ['**/*.svelte.js', '**/*.svelte.ts', '**/*.svelte.*.js', '**/*.svelte.*.ts'], | ||
languageOptions: { | ||
parser: svelteParser | ||
} | ||
}, | ||
{ | ||
name: 'local/markdown', | ||
files: ['**/*.md'], | ||
processor: 'markdown/markdown' | ||
}, | ||
{ | ||
name: 'local/markdown-codefences', | ||
files: ['**/*.md/*.js', '**/*.md/*.ts', '**/*.md/*.svelte'], | ||
rules: { | ||
'n/no-missing-import': 'off', | ||
'@typescript-eslint/no-unused-vars': 'off' | ||
} | ||
}, | ||
{ | ||
name: 'local/spec-files', | ||
files: ['**/__tests__/**/*.spec.ts'], | ||
|
||
languageOptions: { | ||
globals: { | ||
...globals.jest, | ||
...globals.node, | ||
...globals.browser | ||
} | ||
}, | ||
rules: { | ||
'n/no-missing-import': 'off' | ||
} | ||
}, | ||
{ | ||
name: 'local/allow-unused-vars', | ||
files: ['**/vite.config.*', 'packages/e2e-tests/**', '**/*.d.ts'], | ||
rules: { | ||
'no-unused-vars': 'off', | ||
'@typescript-eslint/no-unused-vars': 'off' | ||
} | ||
} | ||
]; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.