Skip to content

Instantly share code, notes, and snippets.

@cmcculloh-kr
Created September 26, 2016 16:40
Show Gist options
  • Save cmcculloh-kr/21a9d625798531bf9173f60b4987f966 to your computer and use it in GitHub Desktop.
Save cmcculloh-kr/21a9d625798531bf9173f60b4987f966 to your computer and use it in GitHub Desktop.
extends: ['eslint-config-airbnb'],
rules: {
'comma-dangle': [2, 'never'],
'id-length': [2, {
'min': 2,
'properties': 'never',
'exceptions': ['$', '_', 'e', 'i', 'j', 'a', 'b', 'n']
}],
'indent': [2, 'tab', {
'SwitchCase': 1
}],
'func-names': 0,
'max-len': [1, 140, 4, {
'ignoreUrls': true,
'ignoreComments': true,
'ignorePattern': '^(\\s*)<([^\'{}();])+$'
}],
'no-case-declarations': 1,
'no-console': 1,
'no-multi-spaces': [1, {
// Object keys are Abstract Syntax Tree types
'exceptions': {
'VariableDeclarator': true,
'Property': true,
'ImportDeclaration': true,
'AssignmentExpression': true,
'JSXAttribute': true
}
}],
'no-param-reassign': [1, {
'props': false
}],
'no-trailing-spaces': [2, {
'skipBlankLines': true
}],
'no-undef': 1,
'space-before-function-paren': [2, 'always'],
'vars-on-top': 1,
'prefer-template': 1,
//
// eslint-plugin-react
// https://github.com/yannickcr/eslint-plugin-react
//
// Prevent missing displayName in a React component definition
'react/display-name': [1, {
'ignoreTranspilerName': true
}],
'react/jsx-indent': [2, 'tab'],
// indent props passed to React component
'react/jsx-indent-props': [1, 'tab'],
// 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',
}],
// Disallow undeclared variables in JSX
'react/jsx-no-undef': 2,
// Prevent multiple component definition per file
'react/no-multi-comp': 0,
// Prevent usage of unknown DOM property
'react/no-unknown-property': 2,
// ES6 classes vs React's createClass method
'react/prefer-es6-class': [2, 'never'],
// Don't enforce stateless React Components to be written as a pure function (for now)
'react/prefer-stateless-function': 0,
// Prevent missing props validation in a React component definition
'react/prop-types': 1,
// Prevent sorting of props or propTypes
'react/sort-comp': 0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment