at main 1.9 kB view raw
1const DEFAULT_ATTRS = require('./tools/build-icons/render/default-attrs.json'); 2 3module.exports = { 4 root: true, 5 env: { 6 browser: true, 7 node: true, 8 }, 9 extends: ['airbnb-base', 'prettier'], 10 plugins: ['import', '@html-eslint'], 11 rules: { 12 'no-console': 'off', 13 'no-param-reassign': 'off', 14 'no-shadow': 'off', 15 'no-use-before-define': 'off', 16 'import/no-extraneous-dependencies': [ 17 'error', 18 { 19 devDependencies: ['**/*.test.js', '**/*.spec.js', '**/scripts/**'], 20 }, 21 ], 22 'import/extensions': [ 23 'error', 24 { 25 pattern: { 26 mjs: 'always', 27 json: 'always', 28 }, 29 }, 30 ], 31 }, 32 parserOptions: { 33 tsconfigRootDir: __dirname, 34 project: ['./docs/tsconfig.json', './packages/*/tsconfig.json'], 35 ecmaVersion: 'latest', 36 sourceType: 'module', 37 }, 38 overrides: [ 39 { 40 files: ['./icons/*.svg'], 41 parser: '@html-eslint/parser', 42 rules: { 43 '@html-eslint/require-doctype': 'off', 44 '@html-eslint/no-duplicate-attrs': 'error', 45 '@html-eslint/no-inline-styles': 'error', 46 '@html-eslint/require-attrs': [ 47 'error', 48 ...Object.entries(DEFAULT_ATTRS).map(([attr, value]) => ({ 49 tag: 'svg', 50 attr, 51 value: String(value), 52 })), 53 ], 54 '@html-eslint/indent': ['error', 2], 55 '@html-eslint/no-multiple-empty-lines': ['error', { max: 0 }], 56 '@html-eslint/no-extra-spacing-attrs': [ 57 'error', 58 { 59 enforceBeforeSelfClose: true, 60 }, 61 ], 62 '@html-eslint/require-closing-tags': [ 63 'error', 64 { 65 selfClosing: 'always', 66 allowSelfClosingCustom: true, 67 }, 68 ], 69 '@html-eslint/element-newline': 'error', 70 '@html-eslint/no-trailing-spaces': 'error', 71 '@html-eslint/quotes': 'error', 72 }, 73 }, 74 ], 75};