-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
React Airbnb Styleguide setup #147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Install the dependencies
Then you can simply use the recommended config if you like: {
"extends": ["airbnb", "plugin:@typescript-eslint/recommended"],
} Otherwise, you can configure our plugin yourself: {
"extends": ["airbnb"],
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"rules": {
"@typescript-eslint/rule-name": "error"
}
} |
It would probably be good for us to document this considering it is probably a very common use case. |
Hi, I have a working airbnb + typescript + prettier .eslintrc.js, this might help you: eslint/eslint#8813 (comment) |
Sadly this did not work. I run that command after reverting the suggested commands.
Then I had to install some peer dependencies
and extended .eslintrc.json with the suggestion
But the App.tsx does not get linted for airbnb styles. I setup VS-Code workspace settings with
so after saving I can see that prettier is applying some airbnb rules. But the usual styleguide gets igonored. I tested it with react/jsx-no-bind from here |
@bradzacher I refer to the following configuration. {
"extends": ["airbnb", "plugin:@typescript-eslint/recommended"],
} This is allowing rules in For TypeScript variant of Airbnb, I concluded that it would not be as straightforward, which is what I'm trying to achieve in my repo. |
No, it does work that way, because the base rule In our recommended, we do switch off the base rules that conflict, and turn on our version however, note you'll lose airbnb's config for those rules, and it'll instead just use the default config for the rule. |
typescript-eslint/typescript-eslint#147 yarn add -D eslint eslint-config-airbnb eslint-plugin-import eslint-plugin-react @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint --init
I would like to know if it is possible to have a react / react-native typescript project with eslint and airbnb-react styleguide by using this lib?
The text was updated successfully, but these errors were encountered: