Skip to content
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

Upgrade to latest eslint and eslint-plugin-react #18

Merged
merged 2 commits into from Jun 20, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -36,7 +36,7 @@ You can override settings from the configuration(s) by adding them directly to y

We have added some additional optional configurations that you can add on top of the base `zeal` config:

* `zeal/react`: Adds rules for [React](https://github.com/reactjs) development. You'll need to install [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) `^5.1.1` to use this configuration.
* `zeal/react`: Adds rules for [React](https://github.com/reactjs) development. You'll need to install [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) to use this configuration.
* `zeal/mocha`: Overrides rules for use with [Mocha](https://mochajs.org/). We recommend creating a separate `.eslintrc` file in the directory containing your tests and `extend`ing this config there.
* `zeal/chai`: Overrides rules for use with [Chai](http://chaijs.com/). We recommend creating a separate `.eslintrc` file in the directory containing your tests and `extend`ing this config there.

Expand Down Expand Up @@ -96,8 +96,8 @@ or, if your webpack config file is not in the default location:

This plugin contains all of the rules available in:

* [ESLint](http://eslint.org/): 2.10.2
* [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react): 5.1.1
* [ESLint](http://eslint.org/): 2.13.1
* [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react): 5.2.2
* [eslint-plugin-import](https://github.com/benmosher/eslint-plugin-import): 1.8.0

## License
Expand Down
15 changes: 15 additions & 0 deletions index.js
Expand Up @@ -64,6 +64,8 @@ module.exports = {
// disallow the use of object properties of the global object (Math and
// JSON) as functions
'no-obj-calls': 1,
// Disallow use of Object.prototypes builtins directly
'no-prototype-builtins': 1,
// disallow multiple spaces in a regular expression literal
'no-regex-spaces': 1,
// disallow sparse arrays
Expand Down Expand Up @@ -328,6 +330,8 @@ module.exports = {
'max-depth': 1,
// specify the maximum length of a line in your program
'max-len': [1, 80, 2],
// enforce a maximum file length
'max-lines': 0,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does 'max-lines': 0 mean there is no maximum, or is this saying the max number of lines is 0? If means the same as it reads, it might be a typo.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It means this rule is disabled. For all of the rules, a single value means 'off' (0), 'warning' (1), or 'error' (2). If there is configuration, then it goes in an array, where the first element is the same as above, and the remaining values are config.

ESLint recently introduced support for using words instead of numbers; might be a good idea to adopt that at some point to make the config clearer.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. Thanks for the clarification!

// specify the maximum depth callbacks can be nested
'max-nested-callbacks': [1, 3],
// limits the number of parameters that can be used in the function
Expand Down Expand Up @@ -358,6 +362,8 @@ module.exports = {
'no-inline-comments': 0,
// disallow if as the only statement in an else block
'no-lonely-if': 1,
// disallow mixes of different operators
'no-mixed-operators': 1,
// disallow mixed spaces and tabs for indentation
'no-mixed-spaces-and-tabs': 1,
// disallow multiple empty lines
Expand All @@ -384,6 +390,8 @@ module.exports = {
'no-underscore-dangle': 1,
// disallow the use of ternary operators when a simpler alternative exists
'no-unneeded-ternary': 1,
// enforce consistent line breaks inside braces
'object-curly-newline': 0,
// require or disallow padding inside curly braces
'object-curly-spacing': [1, 'always'],
// enforce placing object properties on separate lines
Expand Down Expand Up @@ -426,6 +434,8 @@ module.exports = {
// require or disallow a space immediately following the // or /* in a
// comment
'spaced-comment': 1,
// require or disallow the Unicode BOM
'unicode-bom': 1,
// require regex literals to be wrapped in parentheses
'wrap-regex': 1,

Expand Down Expand Up @@ -460,6 +470,9 @@ module.exports = {
'no-useless-computed-key': 1,
// disallow unnecessary constructor
'no-useless-constructor': 1,
// disallow renaming import, export, and destructured assignments to the
// same name
'no-useless-rename': 1,
// require let or const instead of var
'no-var': 1,
// require method and property shorthand syntax for object literals
Expand All @@ -479,6 +492,8 @@ module.exports = {
'prefer-template': 1,
// disallow generator functions that do not have yield
'require-yield': 1,
// enforce spacing between rest and spread operators and their expressions
'rest-spread-spacing': 1,
// enforce spacing around embedded expressions of template strings
'template-curly-spacing': 1,
// enforce spacing around the * in yield* expressions
Expand Down
8 changes: 4 additions & 4 deletions package.json
Expand Up @@ -35,14 +35,14 @@
],
"devDependencies": {
"babel-eslint": "^6.0.4",
"eslint": "^2.10.2",
"eslint-find-rules": "^1.9.2",
"eslint": "^2.13.1",
"eslint-find-rules": "^1.10.0",
"eslint-plugin-import": "^1.8.0",
"eslint-plugin-react": "^5.1.1"
"eslint-plugin-react": "^5.2.2"
},
"peerDependencies": {
"babel-eslint": "^6.0.4",
"eslint": "^2.10.2",
"eslint": "^2.13.1",
"eslint-plugin-import": "^1.8.0"
}
}
8 changes: 8 additions & 0 deletions react.js
Expand Up @@ -19,6 +19,8 @@ module.exports = {
'react/jsx-curly-spacing': 1,
// Enforce or disallow spaces around equal signs in JSX attributes
'react/jsx-equals-spacing': 1,
// Restrict file extensions that may contain JSX
'react/jsx-filename-extension': 0,
// Enforce position of the first prop in JSX
'react/jsx-first-prop-new-line': [1, 'multiline'],
// Enforce event handler naming conventions in JSX
Expand Down Expand Up @@ -51,6 +53,8 @@ module.exports = {
'react/jsx-uses-react': 1,
// Prevent variables used in JSX to be incorrectly marked as unused
'react/jsx-uses-vars': 1,
// Prevent comments from being inserted as text nodes
'react/no-comment-textnodes': 1,
// Prevent usage of dangerous JSX properties
'react/no-danger': 1,
// Prevent usage of deprecated methods
Expand All @@ -65,6 +69,8 @@ module.exports = {
'react/no-is-mounted': 1,
// Prevent multiple component definition per file
'react/no-multi-comp': [1, { ignoreStateless: true }],
// Prevent usage of the return value of React.render
'react/no-render-return-value': 1,
// Prevent usage of setState
'react/no-set-state': 1,
// Prevent using string references in ref attribute
Expand All @@ -81,6 +87,8 @@ module.exports = {
'react/react-in-jsx-scope': 1,
// Restrict file extensions that may be required
'react/require-extension': 1,
// Enforce React components to have a shouldComponentUpdate method
'react/require-optimization': 0,
// Enforce ES5 or ES6 class for returning value in render function
'react/require-render-return': 1,
// Prevent extra closing tags for components without children
Expand Down