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,
|
2022-11-07 22:29:19 +01:00
|
|
|
node: true,
|
2020-10-06 20:23:26 +02:00
|
|
|
},
|
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',
|
2022-11-07 22:29:19 +01:00
|
|
|
'import/no-extraneous-dependencies': [
|
|
|
|
|
'error',
|
2024-06-28 11:24:37 +02:00
|
|
|
{
|
|
|
|
|
devDependencies: ['**/*.test.js', '**/*.spec.js', '**/scripts/**'],
|
|
|
|
|
},
|
2022-11-07 22:29:19 +01:00
|
|
|
],
|
|
|
|
|
'import/extensions': [
|
|
|
|
|
'error',
|
|
|
|
|
{
|
|
|
|
|
pattern: {
|
|
|
|
|
mjs: 'always',
|
|
|
|
|
json: 'always',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
],
|
2022-09-13 09:03:13 +02:00
|
|
|
},
|
|
|
|
|
parserOptions: {
|
|
|
|
|
tsconfigRootDir: __dirname,
|
2024-01-02 15:14:34 +01:00
|
|
|
project: ['./docs/tsconfig.json', './packages/*/tsconfig.json'],
|
2022-12-04 22:38:56 +01:00
|
|
|
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
|
|
|
};
|