Skip to content

Instantly share code, notes, and snippets.

@abhilashsajeev
Created January 23, 2016 09:25
Show Gist options
  • Save abhilashsajeev/62f069e02cbbe57c866b to your computer and use it in GitHub Desktop.
Save abhilashsajeev/62f069e02cbbe57c866b to your computer and use it in GitHub Desktop.
gulp.task('eslint', function () {
gulp.src(config.src)
.pipe(eslint({
extends: 'eslint:recommended',
plugins: [
'react'
],
ecmaFeatures: {
'modules': true,
'jsx': true
},
rules: {
'react/display-name': 0,
'react/forbid-prop-types': 0,
'react/jsx-boolean-value': 1,
'react/jsx-closing-bracket-location': 0,
'react/jsx-curly-spacing': 1,
'react/jsx-indent-props': 1,
'react/jsx-key': 1,
'react/jsx-max-props-per-line': 1,
'react/jsx-no-bind': 1,
'react/jsx-no-duplicate-props': 1,
'react/jsx-no-literals': 1,
'react/jsx-no-undef': 1,
'react/jsx-quotes': 0,
'react/jsx-sort-prop-types': 1,
'react/jsx-sort-props': 1,
'react/jsx-uses-react': 1,
'react/jsx-uses-vars': 1,
'react/no-danger': 0,// because of image tag
'react/no-did-mount-set-state': 1,
'react/no-did-update-set-state': 1,
'react/no-direct-mutation-state': 1,
'react/no-multi-comp': 1,
'react/no-set-state': 0,
'react/no-unknown-property': 1,
'react/prefer-es6-class': 0,
'react/prop-types': 1,
'react/react-in-jsx-scope': 1,
'react/require-extension': 0,
'react/self-closing-comp': 1,
'react/sort-comp': 1,
'react/wrap-multilines': 1,
'indent': [2, 2, { 'SwitchCase': 1 }],
'global-require': 2,
'one-var': [2, 'never'],
'camelcase': 2,
'curly': 2,
'brace-style': [2, '1tbs'],
'quotes': [2, 'single'],
'space-infix-ops': 2,
'dot-notation': 2,
'eqeqeq': [2, 'smart'],
'no-redeclare': 2,
'no-unused-vars': [2, { 'vars': 'all', 'args': 'after-used' }],
'no-floating-decimal': 2,
'no-spaced-func': 2,
'no-underscore-dangle': 0,
'valid-jsdoc': 0,
'space-after-keywords': 2,
'space-before-blocks': 2,
'space-before-function-paren': [2, { "anonymous": "always", "named": "never" }],
'key-spacing': [2, {"beforeColon": false, "afterColon": true}],
'max-len': [2, 180],
'no-use-before-define': [2, 'nofunc'],
'no-warning-comments': 0,
'strict': [2, 'global'],
'eol-last': 0,
'semi': 2
},
globals: {
'React': true,
'const': true
},
envs: [
'browser',
'es6',
'amd',
'commonjs',
'node'
]
}))
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment