You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

82 lines
2.5 KiB

3 years ago
  1. module.exports = {
  2. env: {
  3. node: true,
  4. es6: true,
  5. browser: true
  6. },
  7. parserOptions: {
  8. ecmaVersion: 6,
  9. sourceType: 'module',
  10. ecmaFeatures: {
  11. jsx: true,
  12. modules: true,
  13. experimentalObjectRestSpread: true
  14. }
  15. },
  16. rules: {
  17. 'no-console': 'off',
  18. 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
  19. // Best Practices
  20. eqeqeq: 'error',
  21. 'no-invalid-this': 'error',
  22. 'no-return-assign': 'error',
  23. 'no-unused-expressions': ['error', { allowTernary: true }],
  24. 'no-useless-concat': 'error',
  25. 'no-useless-return': 'error',
  26. // Variable
  27. // 'init-declarations': 'error',
  28. 'no-use-before-define': 'error',
  29. // Stylistic Issues
  30. 'array-bracket-newline': ['error', { multiline: true, minItems: null }],
  31. 'array-bracket-spacing': 'error',
  32. 'brace-style': ['error', '1tbs', { allowSingleLine: true }],
  33. 'block-spacing': 'error',
  34. 'comma-dangle': 'error',
  35. 'comma-spacing': 'error',
  36. 'comma-style': 'error',
  37. 'computed-property-spacing': 'error',
  38. 'func-call-spacing': 'error',
  39. 'implicit-arrow-linebreak': ['error', 'beside'],
  40. // indent: ['error', 4],
  41. 'keyword-spacing': 'error',
  42. 'multiline-ternary': ['error', 'never'],
  43. // 'no-lonely-if': 'error',
  44. 'no-mixed-operators': 'error',
  45. 'no-multiple-empty-lines': ['error', { max: 2, maxEOF: 1 }],
  46. 'no-tabs': 'error',
  47. 'no-unneeded-ternary': 'error',
  48. 'no-whitespace-before-property': 'error',
  49. 'nonblock-statement-body-position': 'error',
  50. 'object-property-newline': ['error', { allowAllPropertiesOnSameLine: true }],
  51. 'quote-props': ['error', 'as-needed'],
  52. // quotes: ['error', 'prefer-single'],
  53. semi: ['error', 'never'],
  54. 'semi-spacing': 'error',
  55. 'space-before-blocks': 'error',
  56. // 'space-before-function-paren': 'error',
  57. 'space-in-parens': 'error',
  58. 'space-infix-ops': 'error',
  59. 'space-unary-ops': 'error',
  60. // ES6
  61. 'arrow-spacing': 'error',
  62. 'no-confusing-arrow': 'error',
  63. 'no-duplicate-imports': 'error',
  64. 'no-var': 'error',
  65. 'object-shorthand': 'error',
  66. 'prefer-const': 'error',
  67. 'prefer-template': 'error'
  68. }
  69. // rules: {
  70. // 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
  71. // 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
  72. // semi: ['error', 'never'],
  73. // 'max-len': 'off',
  74. // camelcase: ['error', { properties: 'never', ignoreDestructuring: true, ignoreImports: true }]
  75. // }
  76. }