index.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. },
  43. plugins: [
  44. 'standard',
  45. '@typescript-eslint',
  46. 'react',
  47. 'react-hooks',
  48. 'prettier',
  49. ],
  50. }