Skip to content

Commit 68f2158

Browse files
committed
Add eslint-plugin-bestpractices dependency.
New warning: any time eslint-disable is used. Release version 1.0.14.
1 parent 7f8c55d commit 68f2158

File tree

6 files changed

+13
-1
lines changed

6 files changed

+13
-1
lines changed

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ module.exports = {
77
],
88
plugins: [
99
// Enable plugins that are not natively supported by Code Climate. Otherwise results in build errors.
10+
'eslint-plugin-bestpractices',
1011
'eslint-plugin-deprecate',
1112
'eslint-plugin-sonarjs'
1213
],

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ This is a shared configuration for all Tree repositories. Contains overrides and
44

55
Utilizes the following plugins:
66

7+
- [eslint-plugin-bestpractices](https://github.com/skye2k2/eslint-plugin-bestpractices)
78
- [eslint-plugin-deprecate](https://github.com/AlexMost/eslint-plugin-deprecate)
89
- [eslint-plugin-html](https://github.com/BenoitZugmeyer/eslint-plugin-html)
910
- [eslint-plugin-import](https://github.com/benmosher/eslint-plugin-import)
@@ -32,6 +33,7 @@ Utilizes the following plugins:
3233
'tree'
3334
],
3435
plugins: [
36+
'eslint-plugin-bestpractices',
3537
'eslint-plugin-deprecate',
3638
'eslint-plugin-sonarjs'
3739
]

demo/example-eslint-results.png

337 KB
Loading

demo/example.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
/* Example of a broken JSON file that should trigger the additional rules contained in ./index.js */
22

3+
/*
4+
* Since developers have the ability to disable linting in-line, we keep track of the times where this is done.
5+
*/
6+
// eslint-disable-next
7+
38
// fixMe: Actually make this work
49
// todo: Add documentation
510
// Hack: Note that these work, regardless of case

index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ module.exports = {
4343
* @note - Code Climate does not support deprecate and sonarjs, and breaks if they are present. You will need to add these plugins individually in your .eslintrc.js file.
4444
*/
4545
plugins: [
46+
// 'eslint-plugin-bestpractices',
4647
// 'eslint-plugin-deprecate',
4748
'eslint-plugin-html',
4849
'eslint-plugin-jsdoc',
@@ -92,6 +93,8 @@ module.exports = {
9293
'object-curly-spacing': 'off',
9394
'semi': ['error', 'always'],
9495

96+
'bestpractices/no-eslint-disable': 'warn',
97+
9598
'sonarjs/cognitive-complexity': 'warn',
9699
'sonarjs/max-switch-cases': 'warn',
97100
'sonarjs/no-all-duplicated-branches': 'warn',

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eslint-config-tree",
3-
"version": "1.0.13",
3+
"version": "1.0.14",
44
"description": "Shared Tree configuration that contains overrides and enhancements on top of the base frontier configuration.",
55
"main": "index.js",
66
"repository": {
@@ -21,6 +21,7 @@
2121
"eslint": "^5",
2222
"eslint-config-standard": "^12",
2323
"eslint-config-standard-react": "^7",
24+
"eslint-plugin-bestpractices": "git+https://github.com/skye2k2/eslint-plugin-bestpractices.git",
2425
"eslint-plugin-deprecate": "^0.5",
2526
"eslint-plugin-html": "^4",
2627
"eslint-plugin-import": "^2",

0 commit comments

Comments
 (0)