|
| 1 | +module.exports = { |
| 2 | + env: { |
| 3 | + node: true, |
| 4 | + browser: false |
| 5 | + }, |
| 6 | + extends: [ |
| 7 | + 'ash-nazg/sauron-node', |
| 8 | + // Override ash-nazg's current preference for ESM |
| 9 | + 'plugin:node/recommended-script' |
| 10 | + ], |
| 11 | + settings: { |
| 12 | + polyfills: [ |
| 13 | + ] |
| 14 | + }, |
| 15 | + overrides: [ |
| 16 | + { |
| 17 | + files: ['test/*'], |
| 18 | + env: { |
| 19 | + mocha: true |
| 20 | + }, |
| 21 | + globals: { |
| 22 | + expect: 'readonly' |
| 23 | + }, |
| 24 | + rules: { |
| 25 | + 'func-names': 0 |
| 26 | + } |
| 27 | + }, |
| 28 | + { |
| 29 | + files: ['**/*.md'], |
| 30 | + rules: { |
| 31 | + 'eol-last': 'off', |
| 32 | + 'no-console': 'off', |
| 33 | + 'no-undef': 'off', |
| 34 | + 'no-unused-vars': 'warn', |
| 35 | + 'padded-blocks': 'off', |
| 36 | + 'import/unambiguous': 'off', |
| 37 | + 'import/no-unresolved': 'off', |
| 38 | + 'node/no-missing-import': 'off', |
| 39 | + 'node/no-missing-require': 'off', |
| 40 | + 'func-names': 'off', |
| 41 | + 'import/newline-after-import': 'off', |
| 42 | + 'no-unused-vars': ['error', {varsIgnorePattern: 'CustomStrategy'}], |
| 43 | + strict: 'off', |
| 44 | + // Disable until eslint-plugin-jsdoc may fix: https://github.com/gajus/eslint-plugin-jsdoc/issues/211 |
| 45 | + indent: 'off' |
| 46 | + } |
| 47 | + } |
| 48 | + ], |
| 49 | + globals: { |
| 50 | + // By some ESLint bug, config overrides not working with globals |
| 51 | + require: 'readonly', |
| 52 | + module: 'readonly', |
| 53 | + exports: 'writable' |
| 54 | + }, |
| 55 | + rules: { |
| 56 | + 'comma-dangle': 0, |
| 57 | + 'no-underscore-dangle': 0, |
| 58 | + 'no-param-reassign': 0, |
| 59 | + |
| 60 | + // Disable current preferences of ash-nazg |
| 61 | + 'import/no-commonjs': 0, |
| 62 | + 'node/exports-style': 0, |
| 63 | + |
| 64 | + // Browser only |
| 65 | + 'compat/compat': 0, |
| 66 | + |
| 67 | + // add back different or stricter rules from airbnb |
| 68 | + 'object-curly-spacing': ['error', 'always'], |
| 69 | + 'func-names': 'warn', |
| 70 | + 'max-len': ['error', 100, 2, { |
| 71 | + ignoreUrls: true, |
| 72 | + ignoreComments: false, |
| 73 | + ignoreRegExpLiterals: true, |
| 74 | + ignoreStrings: true, |
| 75 | + ignoreTemplateLiterals: true, |
| 76 | + }], |
| 77 | + 'space-before-function-paren': ['error', { |
| 78 | + anonymous: 'always', |
| 79 | + named: 'never', |
| 80 | + asyncArrow: 'always' |
| 81 | + }], |
| 82 | + 'no-multiple-empty-lines': ['error', { max: 2, maxEOF: 0 }], |
| 83 | + 'arrow-parens': ['error', 'as-needed', { |
| 84 | + requireForBlockBody: true, |
| 85 | + }], |
| 86 | + 'no-empty-function': ['error', { |
| 87 | + allow: [ |
| 88 | + 'arrowFunctions', |
| 89 | + 'functions', |
| 90 | + 'methods', |
| 91 | + ] |
| 92 | + }], |
| 93 | + 'no-unused-vars': ['error', { vars: 'all', args: 'after-used', ignoreRestSiblings: true }], |
| 94 | + 'no-multi-assign': ['error'], |
| 95 | + 'no-unused-expressions': ['error', { |
| 96 | + allowShortCircuit: false, |
| 97 | + allowTernary: false, |
| 98 | + allowTaggedTemplates: false, |
| 99 | + }] |
| 100 | + } |
| 101 | + }; |
0 commit comments