eslint-config-availity
Advanced tools
Comparing version 2.0.0-beta.2 to 2.0.0-beta.3
137
index.js
@@ -1,136 +0,1 @@ | ||
'use strict'; | ||
module.exports = { | ||
'parser': 'babel-eslint', | ||
'env': { | ||
'browser': false, | ||
'node': true, | ||
'es6': true | ||
}, | ||
"parserOptions": { | ||
"ecmaVersion": 6, | ||
"ecmaFeatures": { | ||
"experimentalObjectRestSpread": true, | ||
"modules": false, | ||
"jsx": true | ||
}, | ||
"sourceType": "module" | ||
}, | ||
'rules': { | ||
'strict': [2, 'global'], | ||
'indent': [2, 2, {'SwitchCase': 1 } ], | ||
'quotes': [2, 'single', 'avoid-escape'], | ||
'no-shadow': 2, | ||
'no-shadow-restricted-names': 2, | ||
'no-undef': 2, | ||
'no-unused-vars': [2, {'vars': 'all', 'args': 'after-used'} ], | ||
'no-use-before-define': 2, | ||
'comma-dangle': [2, 'never'], | ||
'no-cond-assign': [2, 'except-parens'], | ||
'no-console': 1, | ||
'no-debugger': 1, | ||
'no-alert': 1, | ||
'no-constant-condition': 1, | ||
'no-dupe-keys': 2, | ||
'no-duplicate-case': 2, | ||
'no-empty': 2, | ||
'no-ex-assign': 2, | ||
'no-extra-boolean-cast': 0, | ||
'no-extra-semi': 2, | ||
'no-func-assign': 2, | ||
'no-inner-declarations': 2, | ||
'no-invalid-regexp': 2, | ||
'no-irregular-whitespace': 2, | ||
'no-obj-calls': 2, | ||
'no-sparse-arrays': 2, | ||
'no-unreachable': 2, | ||
'use-isnan': 2, | ||
'block-scoped-var': 2, | ||
'consistent-return': 0, | ||
'curly': [2, 'multi-line'], | ||
'default-case': 2, | ||
'dot-notation': [2, {'allowKeywords': true } ], | ||
'eqeqeq': 2, | ||
'guard-for-in': 2, | ||
'no-caller': 2, | ||
'no-else-return': 2, | ||
'no-eq-null': 2, | ||
'no-eval': 2, | ||
'no-extend-native': 2, | ||
'no-extra-bind': 2, | ||
'no-fallthrough': 2, | ||
'no-floating-decimal': 2, | ||
'no-implied-eval': 2, | ||
'no-lone-blocks': 2, | ||
'no-loop-func': 2, | ||
'no-multi-str': 2, | ||
'no-native-reassign': 2, | ||
'no-new': 2, | ||
'no-new-func': 2, | ||
'no-new-wrappers': 2, | ||
'no-octal': 2, | ||
'no-octal-escape': 2, | ||
'no-param-reassign': 0, | ||
'no-proto': 2, | ||
'no-redeclare': 2, | ||
'no-return-assign': 2, | ||
'no-script-url': 2, | ||
'no-self-compare': 2, | ||
'no-sequences': 2, | ||
'no-throw-literal': 2, | ||
'no-with': 2, | ||
'radix': 2, | ||
'vars-on-top': 0, | ||
'wrap-iife': [2, 'any'], | ||
'yoda': 2, | ||
'brace-style': [2, '1tbs', {'allowSingleLine': true } ], | ||
'camelcase': [2, {'properties': 'never'} ], | ||
'comma-spacing': [2, {'before': false, 'after': true } ], | ||
'comma-style': [2, 'last'], | ||
'eol-last': 2, | ||
'func-names': 0, | ||
'key-spacing': [2, {'beforeColon': false, 'afterColon': true } ], | ||
'new-cap': [2, {'newIsCap': true } ], | ||
'no-multiple-empty-lines': [2, {'max': 2 } ], | ||
'no-nested-ternary': 2, | ||
'no-new-object': 2, | ||
'no-spaced-func': 2, | ||
'no-trailing-spaces': 2, | ||
'no-extra-parens': [2, 'functions'], | ||
'no-underscore-dangle': 0, | ||
'one-var': [2, 'never'], | ||
'padded-blocks': 0, | ||
'semi': [2, 'always'], | ||
'semi-spacing': [ | ||
2, | ||
{ | ||
'before': false, | ||
'after': true | ||
} | ||
], | ||
'keyword-spacing': 2, | ||
'space-before-function-paren': [ | ||
2, | ||
'never' | ||
], | ||
'space-infix-ops': 2, | ||
'spaced-comment': [ | ||
2, | ||
'always', | ||
{ | ||
'exceptions': [ | ||
'-', | ||
'+' | ||
], | ||
'markers': [ | ||
'=', | ||
'!' | ||
] | ||
} | ||
] | ||
} | ||
} | ||
module.exports = require('./base'); |
{ | ||
"name": "eslint-config-availity", | ||
"version": "2.0.0-beta.2", | ||
"version": "2.0.0-beta.3", | ||
"description": "Shareable ESLint config for Availity projects", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"test": "tape test.js" | ||
}, | ||
"engines": { | ||
"node": ">=4.0" | ||
}, | ||
"repository": { | ||
@@ -15,4 +18,11 @@ "type": "git", | ||
"eslint", | ||
"eslintconfig", | ||
"availity" | ||
], | ||
"files": [ | ||
"index.js", | ||
"brower.js", | ||
"react.js", | ||
"base.js" | ||
], | ||
"author": "Robert McGuinness", | ||
@@ -25,11 +35,14 @@ "license": "MIT", | ||
"peerDependencies": { | ||
"eslint": "^2.1.0", | ||
"babel-eslint": "5.0.0-beta10", | ||
"eslint-plugin-react": "3.16.1" | ||
"eslint": "^2.0.0", | ||
"babel-eslint": "^5.0.0", | ||
"eslint-plugin-react": "^4.0.0" | ||
}, | ||
"devDependencies": { | ||
"babel-eslint": "^5.0.0-beta10", | ||
"eslint": "^2.1.0", | ||
"eslint-plugin-react": "^3.16.1" | ||
"babel-eslint": "^5.0.0", | ||
"eslint": "^2.0.0", | ||
"eslint-plugin-react": "^4.0.0", | ||
"is-plain-obj": "1.1.0", | ||
"tape": "4.4.0", | ||
"temp-write": "2.1.0" | ||
} | ||
} |
170
react.js
module.exports = { | ||
'extends': './browser', | ||
'extends': './base', | ||
@@ -9,39 +9,145 @@ 'plugins': [ | ||
"parserOptions": { | ||
"ecmaFeatures": { | ||
"experimentalObjectRestSpread": true, | ||
"jsx": true | ||
'parserOptions': { | ||
'ecmaFeatures': { | ||
'experimentalObjectRestSpread': true, | ||
'jsx': true | ||
} | ||
}, | ||
// View link below for react rules documentation | ||
// https://github.com/yannickcr/eslint-plugin-react#list-of-supported-rules | ||
'rules': { | ||
'react/display-name': 1, | ||
'react/jsx-boolean-value': 1, | ||
'react/jsx-closing-bracket-location': 1, | ||
'react/jsx-curly-spacing': 1, | ||
'react/jsx-indent-props': 1, | ||
'react/jsx-max-props-per-line': 1, | ||
'react/jsx-no-duplicate-props': 1, | ||
// Prevent missing displayName in a React component definition | ||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/display-name.md | ||
'react/display-name': [0, { 'ignoreTranspilerName': false }], | ||
// Forbid certain propTypes (any, array, object) | ||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/forbid-prop-types.md | ||
'react/forbid-prop-types': [0, { 'forbid': ['any', 'array', 'object'] }], | ||
// Enforce boolean attributes notation in JSX | ||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-boolean-value.md | ||
'react/jsx-boolean-value': [2, 'never'], | ||
// Validate closing bracket location in JSX | ||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-closing-bracket-location.md | ||
'react/jsx-closing-bracket-location': [2, 'line-aligned'], | ||
// Enforce or disallow spaces inside of curly braces in JSX attributes | ||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-curly-spacing.md | ||
'react/jsx-curly-spacing': [0, 'never', { 'allowMultiline': true }], | ||
// Enforce event handler naming conventions in JSX | ||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-handler-names.md | ||
'react/jsx-handler-names': [0, { | ||
'eventHandlerPrefix': 'handle', | ||
'eventHandlerPropPrefix': 'on', | ||
}], | ||
// Validate props indentation in JSX | ||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-indent-props.md | ||
'react/jsx-indent-props': [2, 2], | ||
// Validate JSX has key prop when in array or iterator | ||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-key.md | ||
'react/jsx-key': 0, | ||
// Limit maximum of props on a single line in JSX | ||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-max-props-per-line.md | ||
'react/jsx-max-props-per-line': [0, { 'maximum': 1 }], | ||
// Prevent usage of .bind() and arrow functions in JSX props | ||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-bind.md | ||
'react/jsx-no-bind': 2, | ||
// Prevent duplicate props in JSX | ||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-duplicate-props.md | ||
'react/jsx-no-duplicate-props': [0, { 'ignoreCase': false }], | ||
// Prevent usage of unwrapped JSX strings | ||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-literals.md | ||
'react/jsx-no-literals': 0, | ||
'react/jsx-no-undef': 1, | ||
'jsx-quotes': 1, | ||
'react/jsx-sort-prop-types': 1, | ||
'react/jsx-sort-props': 1, | ||
'react/jsx-uses-react': 1, | ||
'react/jsx-uses-vars': 1, | ||
'react/no-danger': 1, | ||
'react/no-did-mount-set-state': 1, | ||
'react/no-did-update-set-state': 1, | ||
'react/no-direct-mutation-state': 0, // can't find? | ||
'react/no-multi-comp': 1, | ||
'react/no-set-state': 1, | ||
'react/no-unknown-property': 1, | ||
'react/prop-types': 1, | ||
'react/react-in-jsx-scope': 1, | ||
'react/require-extension': 1, | ||
'react/self-closing-comp': 1, | ||
'react/sort-comp': 1, | ||
'react/wrap-multilines': 1 | ||
// Disallow undeclared variables in JSX | ||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-undef.md | ||
'react/jsx-no-undef': 2, | ||
// Enforce PascalCase for user-defined JSX components | ||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-pascal-case.md | ||
'react/jsx-pascal-case': 0, | ||
// Enforce propTypes declarations alphabetical sorting | ||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/sort-prop-types.md | ||
'react/sort-prop-types': [0, { | ||
'ignoreCase': false, | ||
'callbacksLast': false, | ||
}], | ||
// Enforce props alphabetical sorting | ||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-sort-props.md | ||
'react/jsx-sort-props': [0, { | ||
'ignoreCase': false, | ||
'callbacksLast': false, | ||
}], | ||
// Prevent React to be incorrectly marked as unused | ||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-uses-react.md | ||
'react/jsx-uses-react': [2, { 'pragma': 'React' }], | ||
// Prevent variables used in JSX to be incorrectly marked as unused | ||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-uses-vars.md | ||
'react/jsx-uses-vars': 2, | ||
// Prevent usage of dangerous JSX properties | ||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-danger.md | ||
'react/no-danger': 0, | ||
// Prevent usage of deprecated methods | ||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-deprecated.md | ||
'react/no-deprecated': [1, { 'react': '0.14.0' }], | ||
// Prevent usage of setState in componentDidMount | ||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-did-mount-set-state.md | ||
'react/no-did-mount-set-state': [2, 'allow-in-func'], | ||
// Prevent usage of setState in componentDidUpdate | ||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-did-update-set-state.md | ||
'react/no-did-update-set-state': [2, 'allow-in-func'], | ||
// Prevent direct mutation of this.state | ||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-direct-mutation-state.md | ||
'react/no-direct-mutation-state': 0, | ||
// Prevent usage of isMounted | ||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-is-mounted.md | ||
'react/no-is-mounted': 2, | ||
// Prevent multiple component definition per file | ||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-multi-comp.md | ||
'react/no-multi-comp': [2, { 'ignoreStateless': true }], | ||
// Prevent usage of setState | ||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-set-state.md | ||
'react/no-set-state': 0, | ||
// Prevent using string references | ||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-string-refs.md | ||
'react/no-string-refs': 0, | ||
// Prevent usage of unknown DOM property | ||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unknown-property.md | ||
'react/no-unknown-property': 2, | ||
// Require ES6 class declarations over React.createClass | ||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prefer-es6-class.md | ||
'react/prefer-es6-class': [2, 'always'], | ||
// Prevent missing props validation in a React component definition | ||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prop-types.md | ||
'react/prop-types': [2, { 'ignore': [], 'customValidators': [] }], | ||
// Prevent missing React when using JSX | ||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/react-in-jsx-scope.md | ||
'react/react-in-jsx-scope': 2, | ||
// Restrict file extensions that may be required | ||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/require-extension.md | ||
'react/require-extension': [0, { 'extensions': ['.jsx'] }], | ||
// Prevent extra closing tags for components without children | ||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/self-closing-comp.md | ||
'react/self-closing-comp': 2, | ||
// Enforce spaces before the closing bracket of self-closing JSX elements | ||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-space-before-closing.md | ||
'react/jsx-space-before-closing': [2, 'always'], | ||
// Enforce component methods order | ||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/sort-comp.md | ||
'react/sort-comp': [2, { | ||
'order': [ | ||
'static-methods', | ||
'lifecycle', | ||
'/^on.+$/', | ||
'/^(get|set)(?!(InitialState$|DefaultProps$|ChildContext$)).+$/', | ||
'everything-else', | ||
'/^render.+$/', | ||
'render' | ||
] | ||
}], | ||
// Prevent missing parentheses around multilines JSX | ||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/wrap-multilines.md | ||
'react/wrap-multilines': [2, { | ||
declaration: true, | ||
assignment: true, | ||
return: true | ||
}], | ||
} | ||
} | ||
} |
@@ -7,2 +7,3 @@ # eslint-config-availity | ||
[![NPM](http://img.shields.io/npm/v/eslint-config-availity.svg?style=flat-square&label=npm)](https://npmjs.org/package/eslint-config-availity) | ||
[![Build](https://img.shields.io/travis/Availity/eslint-config-availity.svg?style=flat-square&label=build)](https://travis-ci.org/Availity/eslint-config-availity) | ||
@@ -13,3 +14,3 @@ ## Installation | ||
```bash | ||
npm install eslint babel-eslint@next eslint-plugin-react eslint-config-availity --save-dev | ||
npm install eslint babel-eslint eslint-plugin-react eslint-config-availity --save-dev | ||
``` | ||
@@ -21,3 +22,3 @@ | ||
```bash | ||
# .bashrc | ||
# .eslintrc | ||
extends: eslint-config-availity | ||
@@ -30,3 +31,3 @@ ``` | ||
```bash | ||
# .bashrc | ||
# .eslintrc | ||
extends: eslint-config-availity/react | ||
@@ -39,3 +40,3 @@ ``` | ||
```bash | ||
# .bashrc | ||
# .eslintrc | ||
extends: eslint-config-availity/browser | ||
@@ -45,3 +46,4 @@ ``` | ||
## Dependencies | ||
* | ||
* [eslint](https://github.com/eslint/eslint) | ||
* [babel-eslint](https://github.com/babel/babel-eslint) | ||
@@ -48,0 +50,0 @@ |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
14536
265
1
53
6
6
1