微小悟公众号管理系统

.eslintrc.js 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. // http://eslint.org/docs/user-guide/configuring
  2. module.exports = {
  3. root: true,
  4. parser: 'babel-eslint',
  5. parserOptions: {
  6. sourceType: 'module'
  7. },
  8. env: {
  9. browser: true,
  10. },
  11. extends: 'airbnb-base',
  12. // required to lint *.vue files
  13. plugins: [
  14. 'html'
  15. ],
  16. // check if imports actually resolve
  17. 'settings': {
  18. 'import/resolver': {
  19. 'webpack': {
  20. 'config': 'build/webpack.base.conf.js'
  21. }
  22. }
  23. },
  24. // add your custom rules here
  25. 'rules': {
  26. // don't require .vue extension when importing
  27. 'import/extensions': ['error', 'always', {
  28. 'js': 'never',
  29. 'vue': 'never'
  30. }],
  31. // allow optionalDependencies
  32. 'import/no-extraneous-dependencies': ['error', {
  33. 'optionalDependencies': ['test/unit/index.js']
  34. }],
  35. 'no-plusplus': 'off',
  36. 'no-bitwise': 'off',
  37. 'no-param-reassign': ['error', { 'props': false }],
  38. 'semi': ['error', 'never'],
  39. 'curly': ['warn'],
  40. 'indent': [
  41. 'error',
  42. 2,
  43. {
  44. 'SwitchCase': 1,
  45. 'VariableDeclarator': {
  46. 'var': 1,
  47. 'let': 1,
  48. 'const': 1
  49. },
  50. 'MemberExpression': 2
  51. }
  52. ],
  53. 'max-len': ['error', {
  54. 'code': 256
  55. }],
  56. // allow debugger during development
  57. 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0
  58. }
  59. }