This repository has been archived by the owner on Aug 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(ui): linting typescript in svelte components (#847)
Closes #801 *** * proof-of-concept linting typescript in svelte components * rm console log * linting fixups * prettier Co-authored-by: Alexander Simmerl <a.simmerl@gmail.com>
- Loading branch information
1 parent
70991c1
commit b9f8589
Showing
16 changed files
with
709 additions
and
202 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
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,55 @@ | ||
const eslintSveltePreprocess = require("eslint-svelte3-preprocess"); | ||
const svelteConfig = require("./svelte.config"); | ||
|
||
module.exports = { | ||
env: { | ||
node: true, | ||
browser: true, | ||
}, | ||
parser: "@typescript-eslint/parser", | ||
parserOptions: { | ||
createDefaultProgram: true, | ||
ecmaVersion: 2019, | ||
sourceType: "module", | ||
}, | ||
extends: ["eslint:recommended"], | ||
plugins: ["svelte3", "@typescript-eslint"], | ||
overrides: [ | ||
{ | ||
files: ["*.svelte"], | ||
processor: "svelte3/svelte3", | ||
}, | ||
{ | ||
files: ["*.ts", "*.json"], | ||
extends: ["plugin:@typescript-eslint/recommended"], | ||
}, | ||
], | ||
rules: { | ||
// Disallow Unused Variables | ||
// https://eslint.org/docs/rules/no-unused-vars | ||
"no-unused-vars": ["error", { argsIgnorePattern: "^_" }], | ||
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }], | ||
// require using arrow functions as callbacks | ||
// https://eslint.org/docs/rules/prefer-arrow-callback | ||
"prefer-arrow-callback": "error", | ||
// require using template literals instead of string concatenation | ||
// http://eslint.org/docs/rules/prefer-template | ||
"prefer-template": "error", | ||
// require using of const declaration for variables that are never modified after declared | ||
// https://eslint.org/docs/rules/prefer-const | ||
"prefer-const": "error", | ||
// disallow modifying variables that are declared using const | ||
// https://eslint.org/docs/rules/no-const-assign | ||
"no-const-assign": "error", | ||
// require let or const instead of var | ||
// https://eslint.org/docs/rules/no-var | ||
"no-var": "error", | ||
|
||
// require at least one whitespace after comments( // and /*) | ||
// https://eslint.org/docs/rules/spaced-comment | ||
"spaced-comment": ["warn", "always"], | ||
}, | ||
settings: { | ||
"svelte3/preprocess": eslintSveltePreprocess(svelteConfig.preprocess), | ||
}, | ||
}; |
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
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
Oops, something went wrong.