plugins.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. 'use strict';
  2. module.exports = {
  3. // Repeated here from eslint-config-xo in case some plugins set something different
  4. parserOptions: {
  5. ecmaVersion: 2018,
  6. sourceType: 'module',
  7. ecmaFeatures: {
  8. jsx: true
  9. }
  10. },
  11. // -- end repeat
  12. plugins: [
  13. 'no-use-extend-native',
  14. 'ava',
  15. 'unicorn',
  16. 'promise',
  17. 'import',
  18. 'node'
  19. ],
  20. extends: [
  21. 'plugin:ava/recommended',
  22. 'plugin:unicorn/recommended'
  23. ],
  24. settings: {
  25. 'import/core-modules': [
  26. 'electron',
  27. 'atom'
  28. ]
  29. },
  30. rules: {
  31. 'no-use-extend-native/no-use-extend-native': 'error',
  32. 'promise/param-names': 'error',
  33. 'promise/no-return-wrap': ['error', {allowReject: true}],
  34. 'promise/no-new-statics': 'error',
  35. 'promise/no-return-in-finally': 'error',
  36. 'promise/valid-params': 'error',
  37. 'import/default': 'error',
  38. 'import/export': 'error',
  39. 'import/extensions': ['error', {
  40. js: 'never',
  41. json: 'never',
  42. jsx: 'never'
  43. }],
  44. 'import/first': 'error',
  45. 'import/named': 'error',
  46. 'import/namespace': ['error', {allowComputed: true}],
  47. 'import/no-absolute-path': 'error',
  48. 'import/no-webpack-loader-syntax': 'error',
  49. 'import/no-self-import': 'error',
  50. 'import/no-useless-path-segments': 'error',
  51. 'import/newline-after-import': 'error',
  52. 'import/no-amd': 'error',
  53. 'import/no-duplicates': 'error',
  54. // Enable this sometime in the future when Node.js has ES2015 module support
  55. // 'import/unambiguous': 'error',
  56. // enable this sometime in the future when Node.js has ES2015 module support
  57. // 'import/no-commonjs': 'error',
  58. // Looks useful, but too unstable at the moment
  59. // 'import/no-deprecated': 'error',
  60. 'import/no-extraneous-dependencies': 'error',
  61. 'import/no-mutable-exports': 'error',
  62. 'import/no-named-as-default-member': 'error',
  63. 'import/no-named-as-default': 'error',
  64. 'import/no-unresolved': ['error', {commonjs: true}],
  65. 'import/order': 'error',
  66. 'import/no-unassigned-import': ['error', {
  67. allow: ['babel-polyfill', '@babel/polyfill', 'babel-register', '@babel/register']
  68. }],
  69. // Redundant with import/no-extraneous-dependencies
  70. // 'node/no-extraneous-import': 'error',
  71. // 'node/no-extraneous-require': 'error',
  72. // Redundant with import/no-unresolved
  73. // 'node/no-missing-import': 'error',
  74. // 'node/no-missing-require': 'error',
  75. 'node/no-unpublished-bin': 'error',
  76. // Disabled because they're too annoying, see:
  77. // https://github.com/mysticatea/eslint-plugin-node/issues/105
  78. // 'node/no-unpublished-import': ['error', {allowModules: ['electron', 'atom']}],
  79. // 'node/no-unpublished-require': ['error', {allowModules: ['electron', 'atom']}],
  80. // Disabled as the rule doesn't allow to exclude compiled sources
  81. // 'node/no-unsupported-features': 'error',
  82. 'node/process-exit-as-throw': 'error',
  83. // Disabled as the rule doesn't exclude scripts executed with `node` but not referenced in "bin". See https://github.com/mysticatea/eslint-plugin-node/issues/96
  84. // 'node/shebang': 'error',
  85. 'node/no-deprecated-api': 'error'
  86. // Disabled because it causes too much churn and will be moot when we switch to ES2015 modules
  87. // 'node/exports-style': ['error', 'module.exports']
  88. }
  89. };