index.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // This config is used globally at the root of the repo, so it should be as thin
  2. // as possible with rules that we absolutely require across all projects.
  3. module.exports = {
  4. env: {
  5. es6: true,
  6. },
  7. globals: {
  8. Atomics: 'readonly',
  9. SharedArrayBuffer: 'readonly',
  10. },
  11. // We are relying on version that comes with @polkadot/dev
  12. // Newest version is breaking pioneer!
  13. parser: '@typescript-eslint/parser',
  14. parserOptions: {
  15. ecmaFeatures: {
  16. jsx: true,
  17. },
  18. ecmaVersion: 2019,
  19. sourceType: 'module',
  20. },
  21. extends: [
  22. 'standard',
  23. 'eslint:recommended',
  24. 'plugin:@typescript-eslint/recommended',
  25. 'plugin:react/recommended',
  26. // this is only in newer versions of eslint-plugin-react-hooks
  27. // 'plugin:react-hooks/recommended',
  28. 'plugin:prettier/recommended',
  29. 'prettier/@typescript-eslint',
  30. 'prettier/react',
  31. 'prettier/standard',
  32. ],
  33. settings: {
  34. react: {
  35. version: 'detect',
  36. },
  37. },
  38. rules: {
  39. // drop these when using newer versions of eslint-plugin-react-hooks
  40. 'react-hooks/rules-of-hooks': 'error',
  41. 'react-hooks/exhaustive-deps': 'warn',
  42. // only cli projects should really have this rule, web apps
  43. // should prefer using 'debug' package at least to allow control of
  44. // output verbosity if logging to console.
  45. 'no-console': 'off',
  46. },
  47. plugins: [
  48. 'standard',
  49. '@typescript-eslint',
  50. 'react',
  51. 'react-hooks',
  52. 'prettier',
  53. ],
  54. }