chore: use eslint for css linting

This commit is contained in:
ayo 2026-04-02 16:52:24 +02:00
parent e2cac27a25
commit 139d85001c
3 changed files with 48 additions and 0 deletions

View file

@ -1,9 +1,29 @@
// @ts-check
import js from '@eslint/js' import js from '@eslint/js'
import css from '@eslint/css'
import globals from 'globals' import globals from 'globals'
import { defineConfig, globalIgnores } from 'eslint/config' import { defineConfig, globalIgnores } from 'eslint/config'
import stylistic from '@stylistic/eslint-plugin' import stylistic from '@stylistic/eslint-plugin'
export default defineConfig([ export default defineConfig([
{
files: ['**/*.css'],
plugins: {
css
},
languageOptions: {
tolerant: true
},
language: 'css/css',
rules: {
'css/no-duplicate-imports': 'error',
'css/no-empty-blocks': 'error',
'css/no-invalid-at-rules': 'error',
'css/no-invalid-properties': 'error'
},
ignores: ['./src/modules/loading/loading.css']
},
{ {
files: ['**/*.{js,mjs,cjs}'], files: ['**/*.{js,mjs,cjs}'],
plugins: { js, '@stylistic': stylistic}, plugins: { js, '@stylistic': stylistic},

View file

@ -25,6 +25,7 @@
"firebase": "^12.11.0" "firebase": "^12.11.0"
}, },
"devDependencies": { "devDependencies": {
"@eslint/css": "^1.1.0",
"@eslint/js": "^10.0.1", "@eslint/js": "^10.0.1",
"@stylistic/eslint-plugin": "^5.10.0", "@stylistic/eslint-plugin": "^5.10.0",
"eslint": "^10.1.0", "eslint": "^10.1.0",

View file

@ -12,6 +12,9 @@ importers:
specifier: ^12.11.0 specifier: ^12.11.0
version: 12.11.0 version: 12.11.0
devDependencies: devDependencies:
'@eslint/css':
specifier: ^1.1.0
version: 1.1.0
'@eslint/js': '@eslint/js':
specifier: ^10.0.1 specifier: ^10.0.1
version: 10.0.1(eslint@10.1.0) version: 10.0.1(eslint@10.1.0)
@ -64,6 +67,14 @@ packages:
resolution: {integrity: sha512-QUPblTtE51/7/Zhfv8BDwO0qkkzQL7P/aWWbqcf4xWLEYn1oKjdO0gglQBB4GAsu7u6wjijbCmzsUTy6mnk6oQ==} resolution: {integrity: sha512-QUPblTtE51/7/Zhfv8BDwO0qkkzQL7P/aWWbqcf4xWLEYn1oKjdO0gglQBB4GAsu7u6wjijbCmzsUTy6mnk6oQ==}
engines: {node: ^20.19.0 || ^22.13.0 || >=24} engines: {node: ^20.19.0 || ^22.13.0 || >=24}
'@eslint/css-tree@3.6.9':
resolution: {integrity: sha512-3D5/OHibNEGk+wKwNwMbz63NMf367EoR4mVNNpxddCHKEb2Nez7z62J2U6YjtErSsZDoY0CsccmoUpdEbkogNA==}
engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0}
'@eslint/css@1.1.0':
resolution: {integrity: sha512-sNwfLcU3nKXv/v2YglqujwMU4Iv3BDhxldNUd/2FckVab0zdvc9pPlKWxjR6Ap/EU+Y8Pdu853iwvcUpemRhRw==}
engines: {node: ^20.19.0 || ^22.13.0 || >=24}
'@eslint/js@10.0.1': '@eslint/js@10.0.1':
resolution: {integrity: sha512-zeR9k5pd4gxjZ0abRoIaxdc7I3nDktoXZk2qOv9gCNWx3mVwEn32VRhyLaRsDiJjTs0xq/T8mfPtyuXu7GWBcA==} resolution: {integrity: sha512-zeR9k5pd4gxjZ0abRoIaxdc7I3nDktoXZk2qOv9gCNWx3mVwEn32VRhyLaRsDiJjTs0xq/T8mfPtyuXu7GWBcA==}
engines: {node: ^20.19.0 || ^22.13.0 || >=24} engines: {node: ^20.19.0 || ^22.13.0 || >=24}
@ -802,6 +813,9 @@ packages:
long@5.3.2: long@5.3.2:
resolution: {integrity: sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==} resolution: {integrity: sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==}
mdn-data@2.23.0:
resolution: {integrity: sha512-786vq1+4079JSeu2XdcDjrhi/Ry7BWtjDl9WtGPWLiIHb2T66GvIVflZTBoSNZ5JqTtJGYEVMuFA/lbQlMOyDQ==}
minimatch@10.2.5: minimatch@10.2.5:
resolution: {integrity: sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==} resolution: {integrity: sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==}
engines: {node: 18 || 20 || >=22} engines: {node: 18 || 20 || >=22}
@ -1045,6 +1059,17 @@ snapshots:
dependencies: dependencies:
'@types/json-schema': 7.0.15 '@types/json-schema': 7.0.15
'@eslint/css-tree@3.6.9':
dependencies:
mdn-data: 2.23.0
source-map-js: 1.2.1
'@eslint/css@1.1.0':
dependencies:
'@eslint/core': 1.1.1
'@eslint/css-tree': 3.6.9
'@eslint/plugin-kit': 0.6.1
'@eslint/js@10.0.1(eslint@10.1.0)': '@eslint/js@10.0.1(eslint@10.1.0)':
optionalDependencies: optionalDependencies:
eslint: 10.1.0 eslint: 10.1.0
@ -1833,6 +1858,8 @@ snapshots:
long@5.3.2: {} long@5.3.2: {}
mdn-data@2.23.0: {}
minimatch@10.2.5: minimatch@10.2.5:
dependencies: dependencies:
brace-expansion: 5.0.5 brace-expansion: 5.0.5