Skip to content

Commit

Permalink
Adapt ESLint rules for TypeScript more closely
Browse files Browse the repository at this point in the history
Remove errors for missing .ts extensions on imports and replace two
base ESLint rules enabled by AirBnB with their TypeScript-aware
equivalents.
  • Loading branch information
Shadowfiend committed Jul 29, 2021
1 parent 23545c8 commit 67c56e1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@ module.exports = {
// Don't slap build files for importing devDependencies.
{ devDependencies: ["!+(src/api|ui)/**/*.+(ts|js)"] },
],
"import/extensions": [
"error",
{
ts: "never",
},
],
// Replace a couple of base ESLint rules defined by airbnb with TypeScript
// extensions that understand certain TypeScript-specific features.
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": ["error"],
"no-useless-constructor": "off",
"@typescript-eslint/no-useless-constructor": ["error"],
},
ignorePatterns: "dist/",
parser: "@typescript-eslint/parser",
Expand Down

0 comments on commit 67c56e1

Please sign in to comment.