Skip to content

Instantly share code, notes, and snippets.

@justincorrigible
Last active July 25, 2018 04:47
Show Gist options
  • Save justincorrigible/9b788a62d9fa16ce2a55df26abb06388 to your computer and use it in GitHub Desktop.
Save justincorrigible/9b788a62d9fa16ce2a55df26abb06388 to your computer and use it in GitHub Desktop.
module.exports = {
env: {
'browser': true,
'commonjs': true,
'es6': true,
'jest/globals': true,
'jquery': true,
},
extends: [
'airbnb',
'plugin:angular/johnpapa'
],
parser: 'babel-eslint',
plugins: [
'html',
'import',
'jsx-a11y',
'react',
'jest',
],
rules: {
// eslint
'arrow-body-style': 'off',
'arrow-parens': 'off',
'class-methods-use-this': 'off',
'comma-dangle': ['warn', 'always-multiline'],
'func-names': ['warn', 'as-needed'],
'function-paren-newline': ['warn', 'consistent'],
'global-require': 'off',
'indent': [
'warn', 4, {
ArrayExpression: 'first',
CallExpression: { arguments: 'first' },
flatTernaryExpressions: true,
FunctionDeclaration: { parameters: 'first' },
FunctionExpression: { parameters: 'first' },
ignoreComments: true,
ignoredNodes: [ "ConditionalExpression" ],
ImportDeclaration: 'first',
ObjectExpression: 'first',
SwitchCase: 1,
}
],
'max-len': ['warn', {
code: 100, // number of characters
ignoreTrailingComments: true, // ignores only trailing comments
ignoreUrls: true, // ignores lines that contain a URL
ignoreStrings: true, // ignores lines that contains string
ignoreTemplateLiterals: true, // ignores lines that contain a template literal
}],
'new-cap': 'warn',
'no-alert': 'error',
'no-cond-assign': ['error', 'except-parens'],
'no-confusing-arrow': 'off',
'no-console': ['warn', { allow: ['info', 'warn', 'error'] }],
'no-debugger': 'warn',
'no-nested-ternary': 'off',
'no-underscore-dangle': 'off',
'no-unused-expressions': ['warn', {
'allowShortCircuit': true,
'allowTaggedTemplates': true,
'allowTernary': true
}],
'no-unused-vars': 'warn',
'padded-blocks': 'error',
'semi': ['warn', 'always'],
'quotes': ['warn', 'single'],
// plugins
'angular/document-service': 'warn',
'angular/module-getter': 'off',
'angular/window-service': 'warn',
'import/default': 'error',
'import/first': ['warn', 'absolute-first'],
'import/named': 'error',
'import/no-extraneous-dependencies': [
'warn', {
'devDependencies': [
'**/story.jsx',
'**/*.spec.+(js|jsx)'
]
}],
'react/display-name': 'error',
'react/forbid-prop-types': [1, { forbid: ['any'] }],
'react/jsx-indent': ['warn', 4],
'react/jsx-indent-props': ['warn', 'first'],
'react/jsx-boolean-value': 'off',
'react/jsx-filename-extension': 'off',
'react/jsx-key': 'error',
'react/jsx-max-props-per-line': 'off',
'react/jsx-uses-react': ['warn'],
'react/no-danger': 'off',
'react/no-did-mount-set-state': 'warn',
'react/no-did-update-set-state': 'warn',
'react/no-direct-mutation-state': 'warn',
'react/no-multi-comp': 'warn',
'react/no-unknown-property': 'warn',
'react/sort-comp': 'warn',
// work around for latest jsx-a11y breaking changes
// should be removed in future versions when addressed upstream
'jsx-a11y/anchor-is-valid': ['warn', { aspects: ['invalidHref'] }],
'jsx-a11y/href-no-hash': 'off',
'jsx-a11y/label-has-for': [2, {
'components': [ 'Label' ],
'required': {
'some': [
'nesting',
'id',
]
},
'allowChildren': false,
}],
'jsx-a11y/no-static-element-interaction': 'off',
},
settings: {
'import/resolver': {
webpack: {
config: './config/webpack.config.js'
}
}
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment