eslint-config-mulesoft
Advanced tools
@@ -0,1 +1,24 @@ | ||
12.0.0 / 2016-09-24 | ||
================== | ||
- [breaking] Enable react rules: `react/no-unescaped-entities`, `react/no-children-prop` | ||
- [breaking] [deps] update `eslint-config-airbnb-base` | ||
- [patch] disable deprecated and redundant `react/require-extension` rule (#978) | ||
11.2.0 / 2016-09-23 | ||
================== | ||
- [new] set `ecmaVersion` to 2017; enable object rest/spread; update `babel-preset-airbnb` | ||
- [deps] update `eslint`, `eslint-config-airbnb-base`, `eslint-plugin-import`, `eslint-plugin-jsx-a11y`, `eslint-plugin-react`, `eslint-find-rules`, `safe-publish-latest` | ||
11.1.0 / 2016-09-11 | ||
================== | ||
- [deps] update `eslint-config-airbnb-base`, `eslint` | ||
11.0.0 / 2016-09-08 | ||
================== | ||
- [breaking] enable `react` rules: `react/no-danger-with-children`, `react/no-unused-prop-types`, `react/style-prop-object`, `react/forbid-prop-types`, `react/jsx-no-duplicate-props`; set `react/no-danger` to “warn” | ||
- [breaking] enable `jsx-a11y` rules: `jsx-a11y/anchor-has-content`, `jsx-a11y/tabindex-no-positive`, `jsx-a11y/no-static-element-interactions` | ||
- [deps] update `eslint`, `eslint-plugin-react`, `eslint-config-airbnb-base`, `eslint-find-rules`, `eslint-plugin-import`, `eslint-plugin-jsx-a11y` | ||
- [patch] set `ignoreCase` to `true` in disabled rules. | ||
- [docs] use “#” in example command rather than version numbers (#984) | ||
10.0.1 / 2016-08-12 | ||
@@ -2,0 +25,0 @@ ================== |
{ | ||
"name": "eslint-config-mulesoft", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "Mulesoft's ESLint config, following our styleguide", | ||
@@ -48,22 +48,22 @@ "main": "index.js", | ||
"dependencies": { | ||
"eslint-config-mulesoft-base": "^0.1.0" | ||
"eslint-config-mulesoft-base": "^0.2.0" | ||
}, | ||
"devDependencies": { | ||
"babel-preset-airbnb": "^2.0.0", | ||
"babel-preset-airbnb": "^2.1.1", | ||
"babel-tape-runner": "^2.0.1", | ||
"eslint": "^3.3.1", | ||
"eslint-find-rules": "^1.13.0", | ||
"eslint-plugin-import": "^1.13.0", | ||
"eslint-plugin-jsx-a11y": "^2.1.0", | ||
"eslint-plugin-react": "^6.3.0", | ||
"eslint": "^3.9.0", | ||
"eslint-find-rules": "^1.14.3", | ||
"eslint-plugin-import": "^2.0.1", | ||
"eslint-plugin-jsx-a11y": "^2.2.3", | ||
"eslint-plugin-react": "^6.4.1", | ||
"in-publish": "^2.0.0", | ||
"react": ">= 0.13.0", | ||
"safe-publish-latest": "^1.0.1", | ||
"tape": "^4.6.0" | ||
"safe-publish-latest": "^1.1.1", | ||
"tape": "^4.6.2" | ||
}, | ||
"peerDependencies": { | ||
"eslint": "^3.3.1", | ||
"eslint-plugin-jsx-a11y": "^2.1.0", | ||
"eslint-plugin-import": "^1.13.0", | ||
"eslint-plugin-react": "^6.3.0" | ||
"eslint": "^3.9.0", | ||
"eslint-plugin-jsx-a11y": "^2.2.3", | ||
"eslint-plugin-import": "^2.0.1", | ||
"eslint-plugin-react": "^6.4.1" | ||
}, | ||
@@ -70,0 +70,0 @@ "engines": { |
@@ -19,3 +19,3 @@ # eslint-config-mulesoft | ||
export PKG=eslint-config-mulesoft; | ||
npm info "$PKG" peerDependencies --json | command sed 's/[\{\},]//g ; s/: /@/g' | xargs npm install --save-dev "$PKG" | ||
npm info "$PKG@latest" peerDependencies --json | command sed 's/[\{\},]//g ; s/: /@/g' | xargs npm install --save-dev "$PKG@latest" | ||
) | ||
@@ -27,3 +27,3 @@ ``` | ||
```sh | ||
npm install --save-dev eslint-config-mulesoft eslint@^2.9.0 eslint-plugin-jsx-a11y@^1.2.0 eslint-plugin-import@^1.7.0 eslint-plugin-react@^5.0.1 | ||
npm install --save-dev eslint-config-mulesoft eslint@^#.#.# eslint-plugin-jsx-a11y@^#.#.# eslint-plugin-import@^#.#.# eslint-plugin-react@^#.#.# | ||
``` | ||
@@ -30,0 +30,0 @@ |
@@ -12,4 +12,3 @@ module.exports = { | ||
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-has-content.md | ||
// TODO: enable, semver-major | ||
'jsx-a11y/anchor-has-content': ['off', ['']], | ||
'jsx-a11y/anchor-has-content': ['error', ['']], | ||
@@ -82,5 +81,4 @@ // Require ARIA roles to be valid and non-abstract | ||
// Enforce tabIndex value is not greater than zero. | ||
// TODO: evaluate | ||
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/tabindex-no-positive.md | ||
'jsx-a11y/tabindex-no-positive': 'off', | ||
'jsx-a11y/tabindex-no-positive': 'error', | ||
@@ -106,3 +104,12 @@ // ensure <hX> tags have content and are not aria-hidden | ||
'jsx-a11y/scope': 'error', | ||
// require onClick be accompanied by onKeyUp/onKeyDown/onKeyPress | ||
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/click-events-have-key-events.md | ||
// TODO: enable? | ||
'jsx-a11y/click-events-have-key-events': 'off', | ||
// Enforce that DOM elements without semantic behavior not have interaction handlers | ||
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-static-element-interactions.md | ||
'jsx-a11y/no-static-element-interactions': 'error', | ||
}, | ||
}; |
module.exports = { | ||
plugins: [ | ||
'react' | ||
'react', | ||
], | ||
@@ -11,3 +11,3 @@ parserOptions: { | ||
ecmaFeatures: { | ||
jsx: true | ||
jsx: true, | ||
}, | ||
@@ -22,2 +22,18 @@ | ||
'class-methods-use-this': ['error', { | ||
exceptMethods: [ | ||
'render', | ||
'getInitialState', | ||
'getDefaultProps', | ||
'getChildContext', | ||
'componentWillMount', | ||
'componentDidMount', | ||
'componentWillReceiveProps', | ||
'shouldComponentUpdate', | ||
'componentWillUpdate', | ||
'componentDidUpdate', | ||
'componentWillUnmount', | ||
], | ||
}], | ||
// Prevent missing displayName in a React component definition | ||
@@ -29,3 +45,3 @@ // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/display-name.md | ||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/forbid-prop-types.md | ||
'react/forbid-prop-types': ['off', { forbid: ['any', 'array', 'object'] }], | ||
'react/forbid-prop-types': ['error', { forbid: ['any', 'array', 'object'] }], | ||
@@ -73,3 +89,3 @@ // Enforce boolean attributes notation in JSX | ||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-duplicate-props.md | ||
'react/jsx-no-duplicate-props': ['off', { ignoreCase: false }], | ||
'react/jsx-no-duplicate-props': ['error', { ignoreCase: true }], | ||
@@ -94,3 +110,3 @@ // Prevent usage of unwrapped JSX strings | ||
'react/sort-prop-types': ['off', { | ||
ignoreCase: false, | ||
ignoreCase: true, | ||
callbacksLast: false, | ||
@@ -106,3 +122,3 @@ requiredFirst: false, | ||
'react/jsx-sort-props': ['off', { | ||
ignoreCase: false, | ||
ignoreCase: true, | ||
callbacksLast: false, | ||
@@ -123,3 +139,3 @@ shorthandFirst: false, | ||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-danger.md | ||
'react/no-danger': 'off', | ||
'react/no-danger': 'warn', | ||
@@ -180,3 +196,4 @@ // Prevent usage of deprecated methods | ||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/require-extension.md | ||
'react/require-extension': ['error', { extensions: ['.jsx', '.js'] }], | ||
// deprecated in favor of import/extensions | ||
'react/require-extension': ['off', { extensions: ['.jsx', '.js'] }], | ||
@@ -262,4 +279,23 @@ // Require render() methods to return something | ||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-danger-with-children.md | ||
// TODO: enable, semver-major | ||
'react/no-danger-with-children': 'off', | ||
'react/no-danger-with-children': 'error', | ||
// Prevent unused propType definitions | ||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unused-prop-types.md | ||
'react/no-unused-prop-types': ['warn', { | ||
customValidators: [ | ||
], | ||
skipShapeProps: true, | ||
}], | ||
// Require style prop value be an object or var | ||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/style-prop-object.md | ||
'react/style-prop-object': 'error', | ||
// Prevent invalid characters from appearing in markup | ||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unescaped-entities.md | ||
'react/no-unescaped-entities': 'error', | ||
// Prevent passing of children as props | ||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-children-prop.md | ||
'react/no-children-prop': 'error' | ||
}, | ||
@@ -266,0 +302,0 @@ |
@@ -9,3 +9,3 @@ import fs from 'fs'; | ||
fs.readdirSync(path.join(__dirname, '../rules')).forEach(name => { | ||
fs.readdirSync(path.join(__dirname, '../rules')).forEach((name) => { | ||
if (name === 'react.js' || name === 'react-a11y.js') { | ||
@@ -15,9 +15,10 @@ return; | ||
// eslint-disable-next-line import/no-dynamic-require | ||
files[name] = require(`../rules/${name}`); // eslint-disable-line global-require | ||
}); | ||
Object.keys(files).forEach(name => { | ||
Object.keys(files).forEach((name) => { | ||
const config = files[name]; | ||
test(`${name}: does not reference react`, t => { | ||
test(`${name}: does not reference react`, (t) => { | ||
t.plan(2); | ||
@@ -24,0 +25,0 @@ |
@@ -29,3 +29,3 @@ import test from 'tape'; | ||
export default class MyComponent extends React.Component { | ||
/* eslint no-empty-function: 0 */ | ||
/* eslint no-empty-function: 0, class-methods-use-this: 0 */ | ||
${body} | ||
@@ -61,3 +61,3 @@ } | ||
t.test('order: when random method is first', t => { | ||
t.test('order: when random method is first', (t) => { | ||
t.plan(2); | ||
@@ -79,3 +79,3 @@ const result = lint(wrapComponent(` | ||
t.test('order: when random method after lifecycle methods', t => { | ||
t.test('order: when random method after lifecycle methods', (t) => { | ||
t.plan(2); | ||
@@ -82,0 +82,0 @@ const result = lint(wrapComponent(` |
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
42769
8.04%461
8.73%1
Infinity%1
Infinity%