Skip to content

Commit

Permalink
feat(eslint-config): add rules for comments
Browse files Browse the repository at this point in the history
  • Loading branch information
andrepolischuk committed Jan 22, 2024
1 parent 9f5d5bb commit 4376b47
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/eslint-config/js.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module.exports = {
'plugin:sonarjs/recommended',
'plugin:security/recommended-legacy'
],
plugins: ['promise', 'unicorn'],
plugins: ['promise', 'unicorn', 'todo-with-label'],
rules: {
'no-multiple-empty-lines': ['error', {max: 1}],
'no-empty': ['error', {allowEmptyCatch: true}],
Expand Down Expand Up @@ -235,7 +235,14 @@ module.exports = {
'security/detect-possible-timing-attacks': 'error',
'security/detect-pseudoRandomBytes': 'error',
'security/detect-unsafe-regex': 'off',
'security/detect-bidi-characters': 'error'
'security/detect-bidi-characters': 'error',
'todo-with-label/has-valid-pattern': [
'error',
{
pattern:
'^(TODO|NOTE|COMMENT|FIXME|BUG|HACK|INFO|XXX)\\((\\w+-\\d+)\\)\\: (.*)$'
}
]
},
overrides: [
{
Expand Down
1 change: 1 addition & 0 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"eslint-plugin-sonar": "^0.13.2",
"eslint-plugin-sonarjs": "^0.23.0",
"eslint-plugin-ssr-friendly": "^1.3.0",
"eslint-plugin-todo-with-label": "^2.0.0",
"eslint-plugin-unicorn": "^50.0.1"
}
}
7 changes: 7 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2672,6 +2672,13 @@ eslint-plugin-ssr-friendly@^1.3.0:
dependencies:
globals "^13.8.0"

eslint-plugin-todo-with-label@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-todo-with-label/-/eslint-plugin-todo-with-label-2.0.0.tgz#3b5e64ece40994e461b989996fe65bc157e7d454"
integrity sha512-ZFt9ZPBa6kmUphuu3IP1it/9pGwAPtkctFkoWNk6YUSBQ1e3AuEDip4nRxPJsRZ5srN5VwIdJrQrrW1N4X7fdw==
dependencies:
debug "^4.3.4"

eslint-plugin-unicorn@^50.0.1:
version "50.0.1"
resolved "https://registry.yarnpkg.com/eslint-plugin-unicorn/-/eslint-plugin-unicorn-50.0.1.tgz#e539cdb02dfd893c603536264c4ed9505b70e3bf"
Expand Down

0 comments on commit 4376b47

Please sign in to comment.