|
@@ -0,0 +1,318 @@
|
|
|
+module.exports = {
|
|
|
+ root: true,
|
|
|
+ parser: 'babel-eslint',
|
|
|
+ parserOptions: {
|
|
|
+ sourceType: 'module'
|
|
|
+ },
|
|
|
+ env: {
|
|
|
+ browser: true,
|
|
|
+ node: true
|
|
|
+ },
|
|
|
+ extends: 'eslint:recommended',
|
|
|
+
|
|
|
+ plugins: [
|
|
|
+ 'html'
|
|
|
+ ],
|
|
|
+
|
|
|
+ 'settings': {
|
|
|
+ 'import/resolver': {
|
|
|
+ 'webpack': {
|
|
|
+ 'config': 'build/webpack.base.conf.js'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ 'rules': {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
|
|
|
+
|
|
|
+ * Possible Errors
|
|
|
+ */
|
|
|
+
|
|
|
+
|
|
|
+ 'no-extra-parens': ['error', 'all', {'nestedBinaryExpressions': false}],
|
|
|
+
|
|
|
+
|
|
|
+ 'no-unsafe-negation': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'valid-jsdoc': 'off',
|
|
|
+
|
|
|
+
|
|
|
+ * Best Practices
|
|
|
+ */
|
|
|
+
|
|
|
+
|
|
|
+ 'array-callback-return': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ curly: ['error', 'multi-line'],
|
|
|
+
|
|
|
+
|
|
|
+ 'dot-location': ['error', 'property'],
|
|
|
+
|
|
|
+
|
|
|
+ 'dot-notation': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'eqeqeq': ['error', 'smart'],
|
|
|
+
|
|
|
+
|
|
|
+ 'no-caller': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'no-empty-function': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'no-extra-bind': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'no-extra-label': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'no-floating-decimal': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'no-global-assign': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'no-implied-eval': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'no-iterator': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'no-lone-blocks': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'no-multi-spaces': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'no-new-wrappers': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'no-octal-escape': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'no-proto': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'no-self-compare': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'no-throw-literal': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'no-unused-expressions': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'no-useless-call': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'no-useless-concat': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'no-useless-escape': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'no-void': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'wrap-iife': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ yoda: 'error',
|
|
|
+
|
|
|
+
|
|
|
+ * Variables
|
|
|
+ */
|
|
|
+
|
|
|
+
|
|
|
+ 'no-label-var': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'no-undef-init': 'error',
|
|
|
+ 'no-undef': 'off',
|
|
|
+
|
|
|
+ 'no-use-before-define': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ * Node.js and CommonJS
|
|
|
+ */
|
|
|
+
|
|
|
+
|
|
|
+ 'no-new-require': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ * Stylistic Issues
|
|
|
+ */
|
|
|
+
|
|
|
+
|
|
|
+ 'array-bracket-spacing': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'block-spacing': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'brace-style': ['error', '1tbs', {'allowSingleLine': true}],
|
|
|
+
|
|
|
+
|
|
|
+ 'comma-dangle': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'comma-spacing': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'comma-style': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'computed-property-spacing': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'func-call-spacing': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ indent: ['error', 2, {SwitchCase: 1}],
|
|
|
+
|
|
|
+
|
|
|
+ 'jsx-quotes': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'key-spacing': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'keyword-spacing': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'linebreak-style': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'lines-around-directive': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'new-cap': 'off',
|
|
|
+
|
|
|
+
|
|
|
+ 'new-parens': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'no-array-constructor': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'no-new-object': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'no-trailing-spaces': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'no-unneeded-ternary': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'no-whitespace-before-property': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'object-curly-spacing': ['error', 'always'],
|
|
|
+
|
|
|
+
|
|
|
+ 'padded-blocks': ['error', 'never'],
|
|
|
+
|
|
|
+
|
|
|
+ 'quote-props': ['error', 'as-needed'],
|
|
|
+
|
|
|
+
|
|
|
+ quotes: ['error', 'single'],
|
|
|
+
|
|
|
+
|
|
|
+ 'semi-spacing': 'error',
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ 'space-before-blocks': 'error',
|
|
|
+
|
|
|
+ 'no-console': 'off',
|
|
|
+
|
|
|
+
|
|
|
+ 'space-before-function-paren': ['error', 'never'],
|
|
|
+
|
|
|
+
|
|
|
+ 'space-in-parens': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'space-infix-ops': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'space-unary-ops': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'spaced-comment': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'unicode-bom': 'error',
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ * ECMAScript 6
|
|
|
+ */
|
|
|
+
|
|
|
+
|
|
|
+ 'arrow-body-style': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'arrow-parens': ['error', 'as-needed'],
|
|
|
+
|
|
|
+
|
|
|
+ 'arrow-spacing': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'generator-star-spacing': ['error', 'after'],
|
|
|
+
|
|
|
+
|
|
|
+ 'no-duplicate-imports': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'no-useless-computed-key': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'no-useless-constructor': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'no-useless-rename': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'no-var': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'object-shorthand': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'prefer-arrow-callback': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'prefer-const': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'prefer-numeric-literals': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'prefer-rest-params': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'prefer-spread': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'rest-spread-spacing': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'template-curly-spacing': 'error',
|
|
|
+
|
|
|
+
|
|
|
+ 'yield-star-spacing': 'error'
|
|
|
+ }
|
|
|
+}
|