Closed
Description
- ESLint Version: 4.15.0
- Node Version: 8.7.0
- npm Version: 5.5.1
parser babel-eslint
Configuration
/* global module, __dirname */
/* eslint-disable import/no-commonjs, import/no-nodejs-modules */
const path = require('path');
module.exports = {
globals: {
require: false,
process: false,
Promise: false,
fbq: false,
dataLayer: false,
ga: false,
mixpanel: false,
yaCounter: false,
Raven: false,
// browser env
localStorage: false,
document: false,
console: false,
window: false,
setTimeout: false,
clearTimeout: false,
setInterval: false,
clearInterval: false,
navigator: false,
FormData: false,
},
parser: 'babel-eslint',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
sourceType: 'module',
},
plugins: [
'react',
'import',
'class-property',
'brackets',
],
settings: {
'import/resolver': {
webpack: {
config: path.resolve(__dirname, 'webpack-config/dev.js'),
},
},
propWrapperFunctions: ['forbidExtraProps'],
},
rules: {
'quote-props': ['error', 'as-needed'],
'no-use-before-define': ['error', {functions: false, classes: false}],
'space-before-blocks': ['error'],
'no-redeclare': ['error'],
'no-case-declarations': ['error'],
'no-const-assign': ['error'],
'key-spacing': ['error'],
'keyword-spacing': ['error'],
'no-dupe-class-members': ['error'],
'comma-spacing': ['error'],
'no-var': ['error'],
'prefer-const': ['error'],
'space-infix-ops': ['error'],
'eol-last': ['error', 'always'],
indent: ['error', 2, {SwitchCase: 1}],
'no-mixed-spaces-and-tabs': ['error'],
'linebreak-style': ['error', 'unix'],
'default-case': ['error'],
'no-console': ['error'],
'no-alert': ['error'],
'no-debugger': ['error'],
'no-global-assign': ['error'],
'no-dupe-args': ['error'],
'no-dupe-keys': ['error'],
'no-duplicate-case': ['error'],
'no-empty': ['error', {allowEmptyCatch: true}],
'no-extra-boolean-cast': ['error'],
'no-extra-parens': ['error', 'functions'],
'no-extra-semi': ['error'],
'no-irregular-whitespace': ['error'],
'no-multiple-empty-lines': ['error', {max: 2, maxEOF: 1}],
'no-sparse-arrays': ['error'],
'no-undef': ['error'],
'no-unexpected-multiline': ['error'],
'no-unused-expressions': ['error', {allowTaggedTemplates: true, allowTernary: true}],
'no-unreachable': ['error'],
semi: ['error', 'always', {omitLastInOneLineBlock: true}],
'object-curly-spacing': ['error', 'never'],
'arrow-parens': ['error', 'as-needed'],
quotes: ['error', 'single'],
'jsx-quotes': ['error'],
curly: ['error'],
'brace-style': ['error', 'stroustrup'],
'no-multi-spaces': ['error'],
'no-duplicate-imports': ['error'],
'no-restricted-syntax': [
'error',
{
selector: 'AssignmentExpression[left.object.name=\'window\']',
message: 'Don\'t write to window!',
},
],
'comma-dangle': ['error', {
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'always-multiline',
functions: 'always-multiline',
}],
'react/no-unused-state': 'error',
'react/no-unused-prop-types': 'error',
'react/prop-types': 'error',
'react/jsx-uses-react': 'error',
'react/jsx-uses-vars': 'error',
'react/jsx-tag-spacing': ['error', {beforeSelfClosing: 'never'}],
'react/jsx-no-target-blank': 'error',
'react/jsx-no-undef': 'error',
'react/jsx-no-duplicate-props': 'error',
'react/jsx-key': 'error',
'react/jsx-indent': ['error', 2],
'react/jsx-indent-props': ['error', 2],
'import/no-unresolved': 'error',
'import/named': 'error',
'import/default': 'error',
'import/no-commonjs': 'error',
'import/no-nodejs-modules': 'error',
'class-property/class-property-semicolon': ['error', 'always'],
'brackets/array-bracket-newline': 'error',
'brackets/call-parens-newline': 'error',
'brackets/conditional-parens-newline': 'error',
'brackets/func-parens-newline': 'error',
'brackets/object-curly-newline': 'error',
},
};
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
import {Component} from 'react';
export default class MyComponent extends Component {
componentWillReceiveProps({x}) { // no error about x (but should be)
const {y} = this.props; // 'y' is missing in props validation (react/prop-types)
}
}
Some duplication of #814