Skip to content

Question: ESLint extend airbnb #1355

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

Closed
andrezzoid opened this issue Jan 6, 2017 · 6 comments
Closed

Question: ESLint extend airbnb #1355

andrezzoid opened this issue Jan 6, 2017 · 6 comments

Comments

@andrezzoid
Copy link

Hey guys,

first of all, great work with CRA!

Sorry if it's already been asked, but Is it possible to use airbnb's code style with CRA? We're trying to get to a sweet spot where code style is the same across all stacks.

Thanks a lot in advance.

@andrezzoid andrezzoid changed the title ESLint extend airbnb Question: ESLint extend airbnb Jan 6, 2017
@gaearon
Copy link
Contributor

gaearon commented Jan 6, 2017

In CRA, ESLint is only used for checking for possible errors, not for style enforcement.
You can still manually add ESLint and use your own config separately.

@EnoahNetzach
Copy link
Contributor

@andrezzoid we have done it on our projects in a couple of ways.

First and most simply, just add eslint, eslint-config-airbini and all it's peers, and configure it.

If peer dependencies warnings bother you, another "dirty" solution is that of adding a folder in the root of your project (e.g. .eslint), there init a new, private npm project with your eslint dependencies. Then the main root's script should look something like cd .eslint && npm run eslint.

@erika-dike
Copy link

@EnoahNetzach Thanks for the clearing that up. However, I would like to know how to connect the manual eslint config with the create-react-app default start script.

I would like to be able to see errors on the console as I could when I used the default eslint config. Thanks.

@EnoahNetzach
Copy link
Contributor

@andela-cdike unfortunately I don't think that is an option.

@erika-dike
Copy link

@EnoahNetzach Thanks for the help. Fortunately, the eslint config works with my editor so I don't need the console view as such.

@gaearon
Copy link
Contributor

gaearon commented Feb 11, 2017

FWIW, in the future we suggest moving to tools like prettier for stylistic enforcement. It doesn’t seem very wise that developers spend their time manually correcting style issues. In the meantime I hope this discussion helps.

@gaearon gaearon closed this as completed Feb 11, 2017
@lock lock bot locked and limited conversation to collaborators Jan 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants