index.js 1.6 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. 'eslint:recommended',
  23. 'plugin:@typescript-eslint/recommended',
  24. 'plugin:react/recommended',
  25. 'plugin:react-hooks/recommended',
  26. // jsx-a11y conflicts with pioneer rules. At time of writing
  27. // 84 problems -> We want to avoid as much as possible changing code in pioneer at least
  28. // from polkadot-js code base to make it possible to pull from upstream as easily as possible.
  29. // pioneer has an isolated linting config so its safe to enable here.
  30. // Lets try to support an accessible web in future
  31. // 'plugin:jsx-a11y/recommended',
  32. // Turns off all rules that are unnecessary or might conflict with Prettier.
  33. // Allows us to do formatting separately from linting.
  34. 'prettier',
  35. 'prettier/@typescript-eslint',
  36. 'prettier/react',
  37. 'prettier/standard',
  38. // To Display prettier errors as ESLint errors, enable the following configuration,
  39. // And make sure it is the last configuration in the extends array.
  40. 'plugin:prettier/recommended',
  41. ],
  42. settings: {
  43. react: {
  44. version: 'detect',
  45. },
  46. },
  47. plugins: ['@typescript-eslint', 'react', 'react-hooks'],
  48. }