|
| 1 | +const path = require('path'); |
| 2 | + |
| 3 | +module.exports = { |
| 4 | + extends: [ |
| 5 | + '@metamask/eslint-config', |
| 6 | + path.resolve(__dirname, '.eslintrc.jsdoc.js'), |
| 7 | + ], |
| 8 | + |
| 9 | + globals: { |
| 10 | + document: 'readonly', |
| 11 | + window: 'readonly', |
| 12 | + }, |
| 13 | + |
| 14 | + rules: { |
| 15 | + 'default-param-last': 'off', |
| 16 | + 'prefer-object-spread': 'error', |
| 17 | + 'require-atomic-updates': 'off', |
| 18 | + |
| 19 | + // This is the same as our default config, but for the noted exceptions |
| 20 | + 'spaced-comment': [ |
| 21 | + 'error', |
| 22 | + 'always', |
| 23 | + { |
| 24 | + markers: [ |
| 25 | + 'global', |
| 26 | + 'globals', |
| 27 | + 'eslint', |
| 28 | + 'eslint-disable', |
| 29 | + '*package', |
| 30 | + '!', |
| 31 | + ',', |
| 32 | + // Local additions |
| 33 | + '/:', // This is for our code fences |
| 34 | + ], |
| 35 | + exceptions: ['=', '-'], |
| 36 | + }, |
| 37 | + ], |
| 38 | + |
| 39 | + 'no-invalid-this': 'off', |
| 40 | + |
| 41 | + // TODO: remove this override |
| 42 | + 'padding-line-between-statements': [ |
| 43 | + 'error', |
| 44 | + { |
| 45 | + blankLine: 'always', |
| 46 | + prev: 'directive', |
| 47 | + next: '*', |
| 48 | + }, |
| 49 | + { |
| 50 | + blankLine: 'any', |
| 51 | + prev: 'directive', |
| 52 | + next: 'directive', |
| 53 | + }, |
| 54 | + // Disabled temporarily to reduce conflicts while PR queue is large |
| 55 | + // { |
| 56 | + // blankLine: 'always', |
| 57 | + // prev: ['multiline-block-like', 'multiline-expression'], |
| 58 | + // next: ['multiline-block-like', 'multiline-expression'], |
| 59 | + // }, |
| 60 | + ], |
| 61 | + |
| 62 | + // It is common to import modules without assigning them to variables in |
| 63 | + // a browser context. For instance, we may import polyfills which change |
| 64 | + // global variables, or we may import stylesheets. |
| 65 | + 'import/no-unassigned-import': 'off', |
| 66 | + }, |
| 67 | +}; |
0 commit comments