Comments (3)
Hey @David-Else - thanks for looking into this!
This library uses @typescript-eslint/parser
as a local dependency, so there is no need to install it yourself.
Ideally, this would also be the case for ESLint configs and plugins, but ESLint requires them to be in the root.
If uninstalling @typescript-eslint/parser
breaks something, that would be unexpected - let me know! Cheers
from eslint-config-airbnb-typescript.
I read your link, what a messed up situation! Thanks for setting me straight.
from eslint-config-airbnb-typescript.
@iamturns I thought about it more, and now my entire config is in doubt! I would be really grateful if you could take a look and tell me if what I have done is correct and I have no unnecessary duplication or mistakes/suboptimal settings.
I think I need to include @typescript-eslint/parser
in my package.json
for the other plugins? Does your extension already include any of the @typescript-eslint rules I am adding in my extends
?
I would like:
- The recommended eslint rules
- The @typescript-eslint/recommended rules including those that require type checking
- Your airbnb rules
- All the prettier style overrides from
eslint-config-prettier
- My own additional rules
My package.json
:
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^3.1.0",
"@typescript-eslint/parser": "^3.1.0",
"eslint": "^7.1.0",
"eslint-config-airbnb-typescript": "^8.0.2",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-import": "^2.20.2",
"rollup": "^2.13.1",
"typescript": "^3.9.3"
}
and .eslintrc.js
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
parserOptions: {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
tsconfigRootDir: __dirname,
project: ["./tsconfig.json"],
},
plugins: ["@typescript-eslint"],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"airbnb-typescript/base",
"prettier",
"prettier/@typescript-eslint",
],
rules: {
"import/prefer-default-export": "off",
"no-console": "off",
"max-lines-per-function": [
"error",
{
max: 50,
skipBlankLines: true,
skipComments: true,
IIFEs: true,
},
],
"@typescript-eslint/lines-between-class-members": "off",
"@typescript-eslint/no-unnecessary-condition": "error",
"@typescript-eslint/no-unnecessary-qualifier": "error",
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "error",
"@typescript-eslint/no-unnecessary-type-arguments": "error",
"@typescript-eslint/no-dynamic-delete": "error",
"@typescript-eslint/no-require-imports": "error",
"@typescript-eslint/no-throw-literal": "error",
"@typescript-eslint/prefer-readonly": "error",
"@typescript-eslint/prefer-readonly-parameter-types": "error",
"@typescript-eslint/prefer-nullish-coalescing": "error",
"@typescript-eslint/prefer-optional-chain": "error",
"@typescript-eslint/prefer-string-starts-ends-with": "error",
"@typescript-eslint/prefer-ts-expect-error": "error",
"@typescript-eslint/consistent-type-assertions": "error",
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
"@typescript-eslint/member-delimiter-style": "error",
"@typescript-eslint/method-signature-style": "error",
"@typescript-eslint/array-type": "error",
"@typescript-eslint/switch-exhaustiveness-check": "error",
},
};
THANKS!!
from eslint-config-airbnb-typescript.
Related Issues (20)
- Definition for rule @typescript-eslint/space-before-blocks was not found HOT 2
- Error when install
- Adding `airbnb-typescript/base` makes eslint think that no files are included in the project. HOT 1
- Compatibility with new eslint config spec HOT 2
- Parsing error: ESLint was configured to run xxx However, that TSConfig does not include this file
- '@typescript-eslint/indent' rule is broken upstream and should be removed
- Remove comma-dangle
- prefer-const doesn't seem to be used HOT 2
- Is this repo still maintained? HOT 3
- @typescript-eslint/no-redeclare is ignore block scope of const/let
- Configuration for rule "dot-notation" is invalid HOT 9
- Can't override 'no-use-before-define'?
- need to update dependencies HOT 4
- eslint `valid-typeof` disabled by `airbnb-typescript` & `airbnb-typescript/base` when not explicitly added
- @typescript-eslint/no-unused-vars should follow the same pattern with tsc by default
- Conflicting peer dependency in Angular 17
- Bug with generics: TS7060: This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint.
- Support "Flat Config" (ESLint 9) HOT 9
- Update range of compatibility for @typescript-eslint's plugin and parser HOT 16
- Not sure why this is happening. Deploying on AWS Amplify.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eslint-config-airbnb-typescript.