eslint-config-vast-react
Advanced tools
Comparing version 1.0.1 to 1.0.2
40
index.js
@@ -8,10 +8,13 @@ 'use strict'; | ||
], | ||
extends: ['vast', 'plugin:react/recommended'], | ||
extends: [ | ||
'vast', | ||
'plugin:react/recommended' | ||
], | ||
rules: { | ||
// React rules | ||
'react/display-name': 0, // This overrides plugin:react/recommended | ||
'react/forbid-component-props': 2, // Set to 2 for now. Switch to 1 if needed. | ||
'react/display-name': 0, // this overrides plugin:react/recommended | ||
'react/forbid-component-props': 2, // set to 2 for now, switch to 1 if needed | ||
'react/no-children-prop': 2, | ||
'react/no-did-update-set-state': 2, | ||
'react/no-danger': 1, // See https://github.com/zeit/hyper/issues/730#issuecomment-249379034 and https://github.com/eslint/eslint/issues/7030 | ||
'react/no-danger': 1, // see https://github.com/zeit/hyper/issues/730#issuecomment-249379034 and https://github.com/eslint/eslint/issues/7030 | ||
'react/no-danger-with-children': 2, | ||
@@ -21,7 +24,4 @@ 'react/no-direct-mutation-state': 2, | ||
'react/no-unescaped-entities': 2, | ||
'react/no-unused-prop-types': [1, { // Disable this if it returns false positives. | ||
customValidators: [], | ||
skipShapeProps: true | ||
}], | ||
'react/prop-types': 1, // This overrides plugin:react/recommended. Only warn for now. We should probably set this to 2. | ||
'react/no-unused-prop-types': [1, { customValidators: [], skipShapeProps: true }], // disable this if it returns false positives | ||
'react/prop-types': 1, // overrides plugin:react/recommended, only warn for now, we should probably set this to default (2) | ||
'react/style-prop-object': 2, | ||
@@ -35,9 +35,5 @@ | ||
'react/jsx-handler-names': 2, | ||
'react/jsx-no-bind': [2, { | ||
ignoreRefs: true, | ||
allowArrowFunctions: true, | ||
allowBind: false | ||
}], | ||
'react/jsx-no-bind': [2, { ignoreRefs: true, allowArrowFunctions: true, allowBind: false }], | ||
'react/jsx-no-comment-textnodes': 2, | ||
'react/jsx-no-duplicate-props': [2, { ignoreCase: true }], // This overrides plugin:react/recommended | ||
'react/jsx-no-duplicate-props': [2, { ignoreCase: true }], // overrides plugin:react/recommended | ||
'react/jsx-no-target-blank': 2, | ||
@@ -55,14 +51,14 @@ 'react/jsx-pascal-case': 2, | ||
'jsx-a11y/heading-has-content': 2, | ||
'jsx-a11y/href-no-hash': 2, | ||
'jsx-a11y/href-no-hash': 1, | ||
'jsx-a11y/html-has-lang': 2, | ||
'jsx-a11y/img-has-alt': 2, | ||
'jsx-a11y/img-redundant-alt': 2, | ||
'jsx-a11y/label-has-for': 1, // Only warn for now as this rule reports a false positive for wrapping label without `for`. | ||
'jsx-a11y/img-redundant-alt': 1, | ||
'jsx-a11y/label-has-for': 2, // this can report false positives - wrapping labels don't need `for` | ||
'jsx-a11y/lang': 2, | ||
'jsx-a11y/mouse-events-have-key-events': 1, | ||
'jsx-a11y/no-access-key': 2, | ||
'jsx-a11y/no-onchange': 2, | ||
'jsx-a11y/no-static-element-interactions': 1, // We should probably change this to 2. | ||
'jsx-a11y/onclick-has-focus': 2, // Maybe covered by the above rule. | ||
'jsx-a11y/onclick-has-role': 2, // Maybe covered by the above rule. | ||
'jsx-a11y/no-onchange': 1, | ||
'jsx-a11y/no-static-element-interactions': 1, | ||
'jsx-a11y/onclick-has-focus': 1, | ||
'jsx-a11y/onclick-has-role': 1, | ||
'jsx-a11y/role-has-required-aria-props': 2, | ||
@@ -69,0 +65,0 @@ 'jsx-a11y/role-supports-aria-props': 2, |
{ | ||
"name": "eslint-config-vast-react", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "ESLint shareable config for React and react-a11y to be used with eslint-config-vast", | ||
@@ -29,9 +29,9 @@ "main": "index.js", | ||
"dependencies": { | ||
"eslint-config-vast": "1.4.3" | ||
"eslint-config-vast": "1.6.0" | ||
}, | ||
"devDependencies": { | ||
"eslint": "^3.8.1", | ||
"eslint-plugin-jsx-a11y": "2.2.3", | ||
"eslint-plugin-react": "6.4.1", | ||
"pre-commit": "1.1.3" | ||
"eslint-plugin-jsx-a11y": "^2.2.3", | ||
"eslint-plugin-react": "^6.4.1", | ||
"pre-commit": "^1.1.3" | ||
}, | ||
@@ -38,0 +38,0 @@ "peerDependencies": { |
# eslint-config-vast-react | ||
> ESLint [shareable config](http://eslint.org/docs/developer-guide/shareable-configs.html) for React and [react-a11y](https://github.com/evcohen/eslint-plugin-jsx-a11y) to be used with [eslint-config-vast](https://github.com/vast-engineering/eslint-config-vast) | ||
> ESLint [shareable config](http://eslint.org/docs/developer-guide/shareable-configs.html) for React to be used with [eslint-config-vast](https://github.com/vast-engineering/eslint-config-vast) | ||
[![NPM version](https://badge.fury.io/js/eslint-config-vast-react.svg)](https://www.npmjs.org/package/eslint-config-vast-react) [![Dependency Status](https://david-dm.org/vast-engineering/eslint-config-vast-react.svg)](https://david-dm.org/vast-engineering/eslint-config-vast-react) [![devDependency Status](https://david-dm.org/vast-engineering/eslint-config-vast-react/dev-status.svg)](https://david-dm.org/vast-engineering/eslint-config-vast-react?type=dev) [![devDependency Status](https://david-dm.org/vast-engineering/eslint-config-vast-react/peer-status.svg)](https://david-dm.org/vast-engineering/eslint-config-vast-react?type=peer) | ||
This config uses [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) for linting React and JSX, and [eslint-plugin-jsx-a11y](https://github.com/evcohen/eslint-plugin-jsx-a11y) for basic accessibility checks. | ||
## Installation | ||
@@ -16,50 +18,8 @@ | ||
{ | ||
"extends": ["eslint-config-vast", "eslint-config-vast-react"], | ||
"extends": ["eslint-config-vast", "eslint-config-vast-react"] | ||
} | ||
``` | ||
You'll probably need to add another config file in the root folder of the client-side code (e.g. `app/client/.eslintrc`): | ||
See [eslint-config-vast](https://github.com/vast-engineering/eslint-config-vast) for further instructions. | ||
```javascript | ||
{ | ||
"env": { | ||
"browser": true | ||
}, | ||
"parserOptions": { | ||
"sourceType": "module", // if using Babel | ||
"ecmaVersion": 8 // if using Babel | ||
}, | ||
"globals": { | ||
"SOME_GLOBAL": false | ||
}, | ||
"rules": { | ||
// Your overrides... | ||
} | ||
} | ||
``` | ||
> **Note:** You don't need to use babel-eslint (`"parser": "babel-eslint"`) if you are using ES2015 (ES6), ES2016 (ES7) or ES2017 (ES8). | ||
> | ||
> ESLint actually supports ES2015/ES2016/ES2017, JSX, and object rest/spread by default now. | ||
> | ||
> At the moment, you'll need it if you use stuff like class properties, decorators, async/await, types. | ||
### Setting up ESLint | ||
To set up ESLint on your project, run: | ||
npm install eslint --save-dev | ||
Add "eslint" to "scripts" in `package.json`: | ||
```json | ||
"scripts": { | ||
"eslint": "eslint app tests '*.js' --ext .js --ext .jsx" | ||
} | ||
``` | ||
...and then you can run: | ||
npm run eslint | ||
## Related | ||
@@ -66,0 +26,0 @@ - [eslint-config-vast](https://github.com/vast-engineering/eslint-config-vast) |
6760
61
32
+ Addedeslint-config-vast@1.6.0(transitive)
- Removedeslint-config-vast@1.4.3(transitive)
Updatedeslint-config-vast@1.6.0