summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2023-05-12 22:38:17 +0200
committerGitHub <noreply@github.com>2023-05-12 20:38:17 +0000
commitf74501609246646a3ab62b37a1e7469d6fea63b7 (patch)
treef0c6a1bd2bb9097a74ef74a65d798bcfe9de4cd7
parenta4d6f83b5be6b95f288a5ca02eb1f46d8ac0f992 (diff)
downloadgitea-f74501609246646a3ab62b37a1e7469d6fea63b7.tar.gz
gitea-f74501609246646a3ab62b37a1e7469d6fea63b7.zip
Add `eslint-plugin-eslint-comments` (#24690)
Add [eslint-plugin-eslint-comments](https://github.com/mysticatea/eslint-plugin-eslint-comments) which prevents some abuse related to eslint comments.
-rw-r--r--.eslintrc.yaml10
-rw-r--r--package-lock.json29
-rw-r--r--package.json1
3 files changed, 40 insertions, 0 deletions
diff --git a/.eslintrc.yaml b/.eslintrc.yaml
index 5fa6d1e682..d47d8c0349 100644
--- a/.eslintrc.yaml
+++ b/.eslintrc.yaml
@@ -17,6 +17,7 @@ plugins:
- eslint-plugin-custom-elements
- eslint-plugin-regexp
- eslint-plugin-wc
+ - eslint-plugin-eslint-comments
env:
es2022: true
@@ -86,6 +87,15 @@ rules:
dot-notation: [0]
eol-last: [2]
eqeqeq: [2]
+ eslint-comments/disable-enable-pair: [2]
+ eslint-comments/no-aggregating-enable: [2]
+ eslint-comments/no-duplicate-disable: [2]
+ eslint-comments/no-restricted-disable: [0]
+ eslint-comments/no-unlimited-disable: [2]
+ eslint-comments/no-unused-disable: [2]
+ eslint-comments/no-unused-enable: [2]
+ eslint-comments/no-use: [0]
+ eslint-comments/require-description: [0]
for-direction: [2]
func-call-spacing: [2, never]
func-name-matching: [2]
diff --git a/package-lock.json b/package-lock.json
index 72e9cdab9f..4754a8a826 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -61,6 +61,7 @@
"@vitejs/plugin-vue": "4.2.3",
"eslint": "8.40.0",
"eslint-plugin-custom-elements": "0.0.8",
+ "eslint-plugin-eslint-comments": "3.2.0",
"eslint-plugin-import": "2.27.5",
"eslint-plugin-jquery": "1.5.1",
"eslint-plugin-no-jquery": "2.7.0",
@@ -4519,6 +4520,34 @@
"eslint": ">=4.19.0"
}
},
+ "node_modules/eslint-plugin-eslint-comments": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-eslint-comments/-/eslint-plugin-eslint-comments-3.2.0.tgz",
+ "integrity": "sha512-0jkOl0hfojIHHmEHgmNdqv4fmh7300NdpA9FFpF7zaoLvB/QeXOGNLIo86oAveJFrfB1p05kC8hpEMHM8DwWVQ==",
+ "dev": true,
+ "dependencies": {
+ "escape-string-regexp": "^1.0.5",
+ "ignore": "^5.0.5"
+ },
+ "engines": {
+ "node": ">=6.5.0"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/mysticatea"
+ },
+ "peerDependencies": {
+ "eslint": ">=4.19.1"
+ }
+ },
+ "node_modules/eslint-plugin-eslint-comments/node_modules/escape-string-regexp": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
+ "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.8.0"
+ }
+ },
"node_modules/eslint-plugin-import": {
"version": "2.27.5",
"resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.27.5.tgz",
diff --git a/package.json b/package.json
index e0e0644024..21c39aae9c 100644
--- a/package.json
+++ b/package.json
@@ -61,6 +61,7 @@
"@vitejs/plugin-vue": "4.2.3",
"eslint": "8.40.0",
"eslint-plugin-custom-elements": "0.0.8",
+ "eslint-plugin-eslint-comments": "3.2.0",
"eslint-plugin-import": "2.27.5",
"eslint-plugin-jquery": "1.5.1",
"eslint-plugin-no-jquery": "2.7.0",