-
Notifications
You must be signed in to change notification settings - Fork 100
Add Support for typescript-eslint
v8
#354
Comments
Wonderful, the release is out and includes an updated blog post! I don't immediately see additional changes needed from the list above. |
I get this because of the removal of stylistic rules:
|
Yup! The full list of old rules moved to the stylistic plugin can be found here. I hope to have a PR for the maintainer this weekend, but in the interim an example MVP project setup would look something like: DetailsWarning: I slapped this together to use as a reference, just copy and pasting this probably won't work. // package.json
{
"dependencies": {
"@eslint/eslintrc": "^3.1.0",
"eslint-config-airbnb-typescript": "^18.0.0",
"typescript-eslint": "^8.0.0"
},
"overrides": {
"eslint-config-airbnb-typescript": {
"@typescript-eslint/parser": "^8.0.0",
"@typescript-eslint/eslint-plugin": "^8.0.0"
}
}
} // eslint.config.js
import { FlatConfig } from '@eslint/eslintrc';
import typescriptPlugin from 'typescript-eslint';
const compat = new FlatCompat({
baseDirectory: import.meta.dirname,
});
export default typescriptPlugin.config(
...compat.extends('airbnb-base'),
...compat.extends('airbnb-typescript/base'),
...typescriptPlugin.configs.recommendedTypeChecked,
{
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
allowAutomaticSingleRunInference: true,
},
},
},
// Required overrides
{
rules: {
"@typescript-eslint/lines-between-class-members": "off",
"@typescript-eslint/no-throw-literal": "off",
"@typescript-eslint/only-throw-error": "error",
// Already disabled by `prettier-eslint`, if you're using that.
"@typescript-eslint/brace-style": "off",
"@typescript-eslint/comma-dangle": "off",
"@typescript-eslint/comma-spacing": "off",
"@typescript-eslint/func-call-spacing": "off",
"@typescript-eslint/keyword-spacing": "off",
"@typescript-eslint/no-extra-parens": "off",
"@typescript-eslint/no-extra-semi": "off",
"@typescript-eslint/object-curly-spacing": "off",
"@typescript-eslint/semi": "off",
"@typescript-eslint/space-before-blocks": "off",
"@typescript-eslint/space-before-function-paren": "off",
"@typescript-eslint/space-infix-ops": "off",
"@typescript-eslint/quotes": 0,
// Deprecated, but not breaking yet
"@typescript-eslint/no-loss-of-precision": "off",
},
},
); |
@Kenneth-Sills It seems to me that the fix should not only consist of disabling removed rules. Airbnb-typescript should support migrating these rules to similar ones from eslint stylistic. In our organization's config, we have done so. But maybe I am mistaken and the maintainers have a different view on this |
@DiFuks Absolutely! The config above was really to get people going in the interim, and I had yet to have a look at the Feel free to take a look and let me know if you see any issues, I always appreciate a second set of eyes! |
As this currently blocks updating to typescript-eslint 8 which was released: Any news here? :) |
@SteveW94 The maintainer doesn't have much activity, they may be on hiatus. A bit busy this week, but if I do have some time this weekend I can take a look at forking / starting a new project. |
This would be awesome :) |
I would be interested in this too |
Rules updates to come in isolated commits. Closes iamturns#354.
Tomorrow, the ESLint Typescript Plugin's v8 will be released via PR 9165. The changes for this are described in the prerelease blog post (though that may come to be outdated on release), and we'll need corresponding updates for our users to stay up-to-date.
This WILL be a breaking change due to updates in required rules, the API exposed by the new version (which may break siblings plugins), and the move of all formatting rules to the separate ESLint Stylistic project.
@typescript-eslint/no-throw-literal
to@typescript-eslint/only-throw-error
.@typescript-eslint/no-loss-of-precision
(deprecated TS rule, handled correctly in base ESLint).no-unused-vars
unchanged should be fine. This would keep us in line with the AirBnB base config and the justification text of the standard makes no indication that caught errors are excluded.This does NOT address #331 (supporting ESLint v9), which must still wait for upstream compatibility. Nor will it add first-class support for flat configuration.
The text was updated successfully, but these errors were encountered: