Files

76 lines
1.9 KiB
JavaScript
Raw Permalink Normal View History

2024-07-01 21:51:48 +02:00
const DEFAULT_ATTRS = require('./tools/build-icons/render/default-attrs.json');
2023-11-06 11:00:04 +01:00
2020-10-26 08:59:56 +01:00
module.exports = {
2023-11-06 11:00:04 +01:00
root: true,
2020-12-02 13:48:39 +01:00
env: {
browser: true,
node: true,
},
2020-12-02 13:48:39 +01:00
extends: ['airbnb-base', 'prettier'],
2024-01-18 20:36:48 +09:00
plugins: ['import', '@html-eslint'],
2020-12-02 13:48:39 +01:00
rules: {
'no-console': 'off',
'no-param-reassign': 'off',
'no-shadow': 'off',
'no-use-before-define': 'off',
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: ['**/*.test.js', '**/*.spec.js', '**/scripts/**'],
},
],
'import/extensions': [
'error',
{
pattern: {
mjs: 'always',
json: 'always',
},
},
],
2022-09-13 09:03:13 +02:00
},
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./docs/tsconfig.json', './packages/*/tsconfig.json'],
ecmaVersion: 'latest',
sourceType: 'module',
2022-09-13 09:03:13 +02:00
},
2023-11-06 11:00:04 +01:00
overrides: [
{
files: ['./icons/*.svg'],
parser: '@html-eslint/parser',
rules: {
'@html-eslint/require-doctype': 'off',
'@html-eslint/no-duplicate-attrs': 'error',
'@html-eslint/no-inline-styles': 'error',
'@html-eslint/require-attrs': [
2024-02-01 22:38:21 +09:00
'error',
...Object.entries(DEFAULT_ATTRS).map(([attr, value]) => ({
tag: 'svg',
attr,
value: String(value),
})),
2023-11-06 11:00:04 +01:00
],
'@html-eslint/indent': ['error', 2],
2024-02-01 22:38:21 +09:00
'@html-eslint/no-multiple-empty-lines': ['error', { max: 0 }],
2023-11-06 11:00:04 +01:00
'@html-eslint/no-extra-spacing-attrs': [
'error',
{
enforceBeforeSelfClose: true,
},
],
'@html-eslint/require-closing-tags': [
'error',
{
selfClosing: 'always',
allowSelfClosingCustom: true,
},
],
'@html-eslint/element-newline': 'error',
'@html-eslint/no-trailing-spaces': 'error',
'@html-eslint/quotes': 'error',
2024-02-01 22:38:21 +09:00
},
2023-11-06 11:00:04 +01:00
},
],
2020-12-02 13:48:39 +01:00
};