-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(linting): update ESLint to latest version (#6430)
# Motivation We want to update ESLint to its latest version, as it is no longer supported. This follows up on #6391, and it is important because ESLint@8 is outdated.  To minimize the necessary changes due to the differences in how some rules apply now compared to before, I've overwritten certain rules. This will be addressed in a follow-up. # Changes - Upgrades ESLint and relevant packages to the latest version. - Installs new required packages. - Removes packages that are no longer needed. # Tests - Linting should pass as it did previously. # Todos - [ ] Add entry to changelog (if necessary). Not necessary
- Loading branch information
Showing
26 changed files
with
1,119 additions
and
959 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,84 @@ | ||
import jsLint from "@eslint/js"; | ||
import prettierPlugin from "eslint-config-prettier"; | ||
import sveltePlugin from "eslint-plugin-svelte"; | ||
import globals from "globals"; | ||
import svelteParser from "svelte-eslint-parser"; | ||
import tsLint from "typescript-eslint"; | ||
import svelteConfig from "./svelte.config.js"; | ||
|
||
export default [ | ||
jsLint.configs.recommended, | ||
...tsLint.configs.recommended, | ||
{ | ||
name: "globals", | ||
languageOptions: { | ||
globals: { | ||
...globals.browser, | ||
...globals.node, | ||
NodeJS: true, | ||
}, | ||
parser: tsLint.parser, | ||
ecmaVersion: 2020, | ||
sourceType: "module", | ||
parserOptions: { | ||
extraFileExtensions: [".svelte"], | ||
}, | ||
}, | ||
rules: { | ||
"@typescript-eslint/no-unused-vars": [ | ||
"warn", | ||
{ | ||
argsIgnorePattern: "^_", | ||
varsIgnorePattern: "^_", | ||
caughtErrorsIgnorePattern: "^_", | ||
}, | ||
], | ||
"no-underscore-dangle": "off", | ||
// TODO: Fix after migration | ||
"no-constant-binary-expression": "off", | ||
"@typescript-eslint/no-empty-object-type": "off", | ||
"@typescript-eslint/no-unused-expressions": "off", | ||
}, | ||
}, | ||
...sveltePlugin.configs["flat/recommended"], | ||
{ | ||
name: "svelte", | ||
files: ["**/*.svelte"], | ||
languageOptions: { | ||
parser: svelteParser, | ||
parserOptions: { | ||
parser: tsLint.parser, | ||
svelteConfig, | ||
}, | ||
}, | ||
}, | ||
prettierPlugin, | ||
{ | ||
name: "ignores", | ||
ignores: [ | ||
// ignorePatterns | ||
"src/lib/canisters/**/*", | ||
// .eslintignore | ||
"**/.DS_Store", | ||
"build", | ||
".svelte-kit", | ||
"package", | ||
"playwright*", | ||
"**/.env", | ||
"**/.env.*", | ||
"!**/.env.example", | ||
// Ignore files for PNPM, NPM and YARN | ||
"**/pnpm-lock.yaml", | ||
"**/package-lock.json", | ||
"**/yarn.lock", | ||
|
||
"static", | ||
"public", | ||
"scripts", | ||
|
||
"src/lib/canisters/nns-dapp/**/*", | ||
|
||
"**/coverage", | ||
], | ||
}, | ||
]; |
Oops, something went wrong.