Skip to content

Commit

Permalink
Tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Feb 19, 2025
1 parent e1fe11c commit 0b22281
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 7 deletions.
33 changes: 32 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import globals from 'globals';
import stylistic from '@stylistic/eslint-plugin';
import json from '@eslint/json';
import css from '@eslint/css';

const rules = {
'@stylistic/comma-dangle': [
Expand Down Expand Up @@ -733,6 +734,7 @@ const config = {
},
linterOptions: {
reportUnusedDisableDirectives: 'error',
reportUnusedInlineConfigs: 'error',
},
plugins: {
'@stylistic': stylistic,
Expand All @@ -746,6 +748,8 @@ const config = {
const jsonRules = {
'json/no-duplicate-keys': 'error',
'json/no-empty-keys': 'error',
'json/no-unsafe-values': 'error',
'json/no-unnormalized-keys': 'error',
};

const jsonConfig = {
Expand All @@ -765,9 +769,13 @@ const jsoncConfig = {
},
files: [
'**/*.jsonc',
'**/tsconfig.json',
'.vscode/*.json',
],
language: 'json/jsonc',
languageOptions: {
allowTrailingCommas: true,
},
rules: jsonRules,
};

Expand All @@ -782,9 +790,32 @@ const json5Config = {
rules: jsonRules,
};

const cssRules = {
'css/no-duplicate-imports': 'error',
'css/no-empty-blocks': 'error',
'css/no-invalid-at-rules': 'error',
'cs//no-invalid-at-rules': 'error',
'css/no-invalid-properties': 'error',
};

// eslint-disable-next-line no-unused-vars
const cssConfig = {
plugins: {
css,
},
files: [
'**/*.css',
],
language: 'css/css',
rules: cssRules,
};

export default [
config,
jsonConfig,
jsoncConfig,
json5Config,
jsonConfig, // Placed last so non-standard JSONs match first.

// Disabled for now until it becomes more stable.
// cssConfig,
];
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,17 @@
"simple"
],
"dependencies": {
"@eslint/json": "^0.5.0",
"@stylistic/eslint-plugin": "^2.9.0",
"@eslint/css": "^0.3.0",
"@eslint/json": "^0.10.0",
"@stylistic/eslint-plugin": "^4.0.0",
"confusing-browser-globals": "1.0.11",
"globals": "^15.11.0"
"globals": "^15.15.0"
},
"devDependencies": {
"ava": "^6.1.3",
"eslint": "^9.12.0"
"ava": "^6.2.0",
"eslint": "^9.20.1"
},
"peerDependencies": {
"eslint": ">=9.8.0"
"eslint": ">=9.20.0"
}
}

0 comments on commit 0b22281

Please sign in to comment.