Files
lucide/eslint.config.ts
Eric Fennis 141ff59bd7 Update deps
2025-08-01 13:45:23 +02:00

97 lines
2.4 KiB
TypeScript

import { defineConfig } from "eslint/config";
import { type ESLint } from 'eslint';
import DEFAULT_ATTRS from './tools/build-icons/render/default-attrs.json' with { type: 'json' };
import ImportPlugin from 'eslint-plugin-import';
import HtmlPlugin from '@html-eslint/eslint-plugin';
import htmlEslintParser from '@html-eslint/parser';
export default defineConfig([
{
extends: ['airbnb-base', 'prettier'],
plugins: {
'import': ImportPlugin,
},
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',
},
},
],
},
languageOptions: {
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./docs/tsconfig.json', './packages/*/tsconfig.json'],
ecmaVersion: 'latest',
sourceType: 'module',
},
},
ignores: [
"dist",
"build",
"coverage",
"lib",
"tests",
"node_modules",
".eslintrc.js",
"docs/images",
"docs/**/examples/",
"packages/lucide-react/dynamicIconImports.js",
]
},
{
files: ['./icons/*.svg'],
plugins: {
'@html-eslint': HtmlPlugin,
},
languageOptions: {
parser: htmlEslintParser,
},
rules: {
'@html-eslint/require-doctype': 'off',
'@html-eslint/no-duplicate-attrs': 'error',
'@html-eslint/no-inline-styles': 'error',
'@html-eslint/require-attrs': [
'error',
...Object.entries(DEFAULT_ATTRS).map(([attr, value]) => ({
tag: 'svg',
attr,
value: String(value),
})),
],
'@html-eslint/indent': ['error', 2],
'@html-eslint/no-multiple-empty-lines': ['error', { max: 0 }],
'@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',
},
}
]);