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
Add ESLint support #37
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given your comment:
every package we define needs to set this up "manually" (using a local eslintrc file in the tests folder or using a comment in the test file).
Can we add this to the templates that the CLI uses, so that when someone creates a new component via the CLI tool, the local eslintrc
file and/or the comment in the test file get added during that process.
package.json
Outdated
"eslint-config-prettier": "^2.3.0", | ||
"eslint-plugin-import": "^2.6.1", | ||
"eslint-plugin-jsx-a11y": "^5.1.1", | ||
"eslint-plugin-react": "^7.1.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should you we fix the versions for these? This was something we started doing but seemed to have stopped with some later packages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's my preference :-)
The comments were addressed and currently the only thing that is "bugging" me are the code climate complaints (that don't make any sense btw). |
packages/author/package.json
Outdated
"react-native-web": "0.0.96" | ||
}, | ||
"peerDependencies": { | ||
"@storybook/react-native": "^3.1.6" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be added to the template file on /.lib/cli/package-json.js
. Don't forget to fix the version too
packages/author/package.json
Outdated
"react-test-renderer": "15.5.4", | ||
"webpack": "2.6.1" | ||
}, | ||
"dependencies": { | ||
"react": "16.0.0-alpha.6", | ||
"react-dom": "15.5.4", | ||
"react-native": "0.44.2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be downgraded to "0.44.1" so that storybook(-native)
keeps working. Check if the package.json
template is correct (on version 0.44.1) and change it to that version if otherwise.
@fampinheiro @JGAntunes check my last comment on |
ESLing considers the If we want to make use of configuration cascading (which is supported ootb by |
This PR addresses #35. It works by addressing all the issues prettier isn't capable of, such as unused vars and so on - https://github.com/prettier/prettier#how-does-it-compare-to-eslint-or-tslint-stylelint.
The only issue with the current config is with the global variables defined under the test files. These files should be run under a
jest
env, which, right now, every package we define needs to set this up "manually" (using a localeslintrc
file in the __tests__ folder or using a comment in the test file). The newest eslint already supports rules by glob patterns which will be pretty useful in this case, but airbnb plugins still lack support for it. It will just be a matter of updating later on.