Skip to content

Commit e0c352d

Browse files
author
David Bradshaw
committed
Add eslint-plugin-json
1 parent 72912f0 commit e0c352d

File tree

5 files changed

+22
-16
lines changed

5 files changed

+22
-16
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ The following esLint plugins are always loaded in this configuration:
4646
- [eslint-plugin-array-func](https://github.com/freaktechnik/eslint-plugin-array-func)
4747
- [eslint-plugin-eslint-comments](https://github.com/mysticatea/eslint-plugin-eslint-comments)
4848
- [eslint-plugin-html](https://github.com/BenoitZugmeyer/eslint-plugin-html)
49+
- [eslint-plugin-json](https://github.com/azeemba/eslint-plugin-json)
4950
- [eslint-plugin-json-format](https://github.com/Bkucera/eslint-plugin-json-format)
5051
- [eslint-plugin-markdown](https://github.com/eslint/eslint-plugin-markdown)
5152
- [eslint-plugin-no-constructor-bind](https://github.com/markalfred/eslint-plugin-no-constructor-bind)

package.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@
3535
"rimraf": "^3.0.2"
3636
},
3737
"devDependencies": {
38-
"@typescript-eslint/eslint-plugin": "^3.1.0",
38+
"@typescript-eslint/eslint-plugin": "^3.2.0",
3939
"ava": "^3.8.2",
4040
"babel-eslint": "^10.1.0",
4141
"chai": "^4.2.0",
42-
"cypress": "^4.7.0",
43-
"eslint": "^7.1.0",
42+
"cypress": "^4.8.0",
43+
"eslint": "^7.2.0",
4444
"eslint-config-airbnb": "^18.1.0",
4545
"eslint-config-babel": "^9.0.0",
4646
"eslint-config-prettier": "^6.11.0",
@@ -58,10 +58,11 @@
5858
"eslint-plugin-flowtype": "^5.1.3",
5959
"eslint-plugin-fsa": "^1.0.12",
6060
"eslint-plugin-html": "^6.0.2",
61-
"eslint-plugin-import": "^2.20.2",
61+
"eslint-plugin-import": "^2.21.2",
6262
"eslint-plugin-jasmine": "^4.1.1",
6363
"eslint-plugin-jest": "^23.13.2",
6464
"eslint-plugin-jest-async": "^1.0.3",
65+
"eslint-plugin-json": "^2.1.1",
6566
"eslint-plugin-json-format": "^2.0.1",
6667
"eslint-plugin-jsx-a11y": "^6.2.3",
6768
"eslint-plugin-lodash": "^7.1.0",
@@ -70,7 +71,7 @@
7071
"eslint-plugin-mocha": "^7.0.1",
7172
"eslint-plugin-mocha-cleanup": "^1.8.0",
7273
"eslint-plugin-no-constructor-bind": "^2.0.0",
73-
"eslint-plugin-no-secrets": "^0.5.4",
74+
"eslint-plugin-no-secrets": "^0.6.8",
7475
"eslint-plugin-no-unsanitized": "^3.1.1",
7576
"eslint-plugin-no-use-extend-native": "^0.5.0",
7677
"eslint-plugin-only-error": "^1.0.2",
@@ -93,7 +94,7 @@
9394
"in-publish": "^2.0.1",
9495
"jasmine": "^3.5.0",
9596
"jest": "^26.0.1",
96-
"lint-staged": "^10.2.7",
97+
"lint-staged": "^10.2.9",
9798
"lodash-fp": "^0.10.4",
9899
"mocha": "^7.2.0",
99100
"prettier": "^2.0.5",

packages.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const rules = [
55
'array-func',
66
'eslint-comments',
77
'html',
8+
'json',
89
'json-format',
910
'markdown',
1011
'no-constructor-bind',
@@ -16,7 +17,7 @@ const rules = [
1617
'unicorn',
1718

1819
// Security Rules
19-
'no-secrets@0.5.4',
20+
'no-secrets',
2021
'no-unsanitized',
2122
'scanjs-rules',
2223
'security',

rules/json.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
module.exports = {
2-
extends: ['plugin:json/recommended-with-comments'],
3-
plugins: ['json'],
2+
overrides: [
3+
{
4+
files: ['*.json', '**/*.json'],
5+
excludedFiles: ['package.json', '**/package.js'],
6+
extends: ['plugin:json/recommended-with-comments'],
7+
plugins: ['json'],
8+
},
9+
],
410
}

rules/no-secrets.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
module.exports = {
2-
plugins: ['no-secrets'],
3-
rules: {
4-
'no-secrets/no-secrets': 'error',
5-
},
62
overrides: [
73
{
8-
// Plugin does not play well with these filetypes
9-
files: ['**/*.md', '**/*.json'],
4+
plugins: ['no-secrets'],
105
rules: {
11-
'no-secrets/no-secrets': 'off',
6+
'no-secrets/no-secrets': 'error',
127
},
8+
files: ['*', '*/**'],
9+
excludedFiles: ['package.json', '**/package.js'],
1310
},
1411
],
1512
}

0 commit comments

Comments
 (0)