Skip to content

Commit

Permalink
Use @eslint-community/eslint-plugin-eslint-comments (#1689)
Browse files Browse the repository at this point in the history
  • Loading branch information
sndrs authored Sep 4, 2024
1 parent 21e2da5 commit f77f690
Show file tree
Hide file tree
Showing 5 changed files with 133 additions and 279 deletions.
7 changes: 7 additions & 0 deletions libs/@guardian/eslint-config/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @guardian/eslint-config

## 10.0.0-beta.1

### Patch Changes

- Replaces `eslint-plugin-eslint-comments` with `@eslint-community/eslint-plugin-eslint-comments`
- Bumps other dependencies

## 10.0.0-beta.0

### Major Changes
Expand Down
17 changes: 7 additions & 10 deletions libs/@guardian/eslint-config/configs/comments.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,26 @@
import { fixupPluginRules } from '@eslint/compat';
import eslintComments from 'eslint-plugin-eslint-comments';
import comments from '@eslint-community/eslint-plugin-eslint-comments/configs';

export default [
comments.recommended,
{
name: '@guardian/comments',
plugins: {
'eslint-comments': fixupPluginRules(eslintComments),
},
rules: {
// require a `eslint-enable` comment for every `eslint-disable` comment
'eslint-comments/disable-enable-pair': [
'@eslint-community/eslint-comments/disable-enable-pair': [
'error',
{ allowWholeFile: true },
],

// disallow duplicate `eslint-disable` comments
'eslint-comments/no-duplicate-disable': 'error',
'@eslint-community/eslint-comments/no-duplicate-disable': 'error',

// disallow unused eslint-en/disable comments
// (make sure they're not left in after a fix)
'eslint-comments/no-unused-disable': 'error',
'eslint-comments/no-unused-enable': 'error',
'@eslint-community/eslint-comments/no-unused-disable': 'error',
'@eslint-community/eslint-comments/no-unused-enable': 'error',

// require an explanation if you disable eslint
'eslint-comments/require-description': [
'@eslint-community/eslint-comments/require-description': [
'error',
{ ignore: ['eslint-enable'] },
],
Expand Down
2 changes: 1 addition & 1 deletion libs/@guardian/eslint-config/configs/javascript.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default {
// prevent dangling returns without braces
curly: ['error', 'all'],

// delimit members with semi-colons and require
// delimit members with semicolons and require
// one at the end to keep diffs simpler
'@stylistic/member-delimiter-style': [
2,
Expand Down
15 changes: 7 additions & 8 deletions libs/@guardian/eslint-config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@guardian/eslint-config",
"version": "10.0.0-beta.0",
"version": "10.0.0-beta.1",
"description": "ESLint config for Guardian JavaScript projects",
"type": "module",
"main": "index.js",
Expand All @@ -9,20 +9,19 @@
"lint": "wireit"
},
"dependencies": {
"@eslint/compat": "1.1.1",
"@eslint-community/eslint-plugin-eslint-comments": "4.4.0",
"@eslint/js": "9.9.1",
"@stylistic/eslint-plugin": "2.6.4",
"@stylistic/eslint-plugin": "2.7.2",
"eslint-config-prettier": "9.1.0",
"eslint-import-resolver-typescript": "3.6.3",
"eslint-plugin-eslint-comments": "3.2.0",
"eslint-plugin-import-x": "4.0.0",
"eslint-plugin-jsx-a11y": "6.9.0",
"eslint-plugin-react": "7.35.0",
"eslint-plugin-import-x": "4.2.0",
"eslint-plugin-jsx-a11y": "6.10.0",
"eslint-plugin-react": "7.35.2",
"eslint-plugin-react-hooks": "4.6.2",
"eslint-plugin-storybook": "0.8.0",
"globals": "15.9.0",
"read-package-up": "11.0.0",
"typescript-eslint": "8.3.0"
"typescript-eslint": "8.4.0"
},
"devDependencies": {
"eslint": "9.9.0",
Expand Down
Loading

0 comments on commit f77f690

Please sign in to comment.