-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c6bcd8b
commit 419a057
Showing
5 changed files
with
672 additions
and
645 deletions.
There are no files selected for viewing
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,54 @@ | ||
import eslint from "@eslint/js" | ||
import tseslint from "typescript-eslint" | ||
import stylistic from "@stylistic/eslint-plugin" | ||
import tsdoc from "eslint-plugin-tsdoc" | ||
|
||
export default tseslint.config( | ||
// Global ignores for generated files. | ||
{ ignores: ["dist/", "tests/examples/age.js"] }, | ||
|
||
eslint.configs.recommended, | ||
tseslint.configs.recommendedTypeChecked, | ||
tseslint.configs.stylisticTypeChecked, | ||
|
||
{ | ||
languageOptions: { | ||
parserOptions: { | ||
projectService: { | ||
// Allow slow "default project" for .js config files in the root. | ||
allowDefaultProject: ["*.js"] | ||
}, | ||
tsconfigRootDir: import.meta.dirname, | ||
} | ||
}, | ||
plugins: { | ||
"@stylistic": stylistic, | ||
"tsdoc": tsdoc | ||
}, | ||
rules: { | ||
"@stylistic/semi": ["error", "never"], | ||
"@stylistic/quotes": ["error", "double", { "allowTemplateLiterals": true /*"avoidEscape"*/ }], | ||
"@stylistic/brace-style": ["error", "1tbs", { "allowSingleLine": true }], | ||
"@stylistic/indent": ["error", 4], | ||
"curly": ["error", "multi-line"], | ||
|
||
"eqeqeq": "error", | ||
"no-var": "error", | ||
"prefer-const": "error", | ||
"no-constant-binary-expression": "error", | ||
"no-self-compare": "error", | ||
|
||
"tsdoc/syntax": "error" | ||
} | ||
}, | ||
|
||
// tsconfig.json (used by projectService) does not include .js files by default. | ||
// Disable typed linting for the only .js files in the project, the examples. | ||
{ | ||
files: ["tests/examples/*.js"], | ||
extends: [tseslint.configs.disableTypeChecked], | ||
rules: { | ||
"no-undef": "off", | ||
} | ||
}, | ||
) |
Oops, something went wrong.