Skip to content
This repository was archived by the owner on Feb 27, 2024. It is now read-only.

Commit 3d1b529

Browse files
author
Greg Rickaby
authored
Merge pull request #87 from WebDevStudios/feature/add-jsdoc-linting
Feature/add jsdoc linting
2 parents dcc745b + 3d4355a commit 3d1b529

File tree

3 files changed

+42
-3
lines changed

3 files changed

+42
-3
lines changed

.eslintrc.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,20 @@ module.exports = {
1616
'plugin:react/recommended',
1717
'plugin:react-hooks/recommended',
1818
'plugin:jsx-a11y/recommended',
19+
'plugin:jsdoc/recommended',
1920
'prettier'
2021
],
2122
settings: {
2223
react: {
2324
version: 'detect'
25+
},
26+
jsdoc: {
27+
tagNamePreference: {
28+
returns: 'return'
29+
}
2430
}
2531
},
26-
plugins: ['react', 'react-hooks', 'jsx-a11y', 'prettier'],
32+
plugins: ['react', 'react-hooks', 'jsx-a11y', 'prettier', 'jsdoc'],
2733
rules: {
2834
'jsx-a11y/anchor-is-valid': 'off',
2935
'react/react-in-jsx-scope': 'off',
@@ -33,6 +39,10 @@ module.exports = {
3339
extensions: ['.js', '.jsx']
3440
}
3541
],
36-
'prettier/prettier': 'error'
42+
'prettier/prettier': 'error',
43+
'func-style': ['error', 'declaration'],
44+
'jsdoc/check-indentation': 1,
45+
'jsdoc/check-line-alignment': [1, 'always'],
46+
'no-console': ['error', {allow: ['warn', 'error']}]
3747
}
3848
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
"eslint": "^7.17.0",
6161
"eslint-config-prettier": "^7.1.0",
6262
"eslint-plugin-import": "^2.22.1",
63+
"eslint-plugin-jsdoc": "^31.0.3",
6364
"eslint-plugin-jsx-a11y": "^6.4.1",
6465
"eslint-plugin-prettier": "^3.3.1",
6566
"eslint-plugin-react": "^7.22.0",

yarn.lock

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4685,6 +4685,11 @@ commander@^6.0.0, commander@^6.2.0:
46854685
resolved "https://registry.yarnpkg.com/commander/-/commander-6.2.0.tgz#b990bfb8ac030aedc6d11bc04d1488ffef56db75"
46864686
integrity sha512-zP4jEKbe8SHzKJYQmq8Y9gYjtO/POJLgIdKgV7B9qNmABVFVc+ctqSX6iXh4mCpJfRBOabiZ2YKPg8ciDw6C+Q==
46874687

4688+
4689+
version "1.0.1"
4690+
resolved "https://registry.yarnpkg.com/comment-parser/-/comment-parser-1.0.1.tgz#6f40ebc3ac5063cf59b5eb415bc689636134cc4a"
4691+
integrity sha512-korDJ16mBVZexVd485jz4AeAcAFP1UzeecfVgfBCBojLFjMEHEHOY9vgk3e9o1zRSP0EscavonLki4JZDCKmrg==
4692+
46884693
commondir@^1.0.1:
46894694
version "1.0.1"
46904695
resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b"
@@ -5941,6 +5946,19 @@ eslint-plugin-import@^2.22.1:
59415946
resolve "^1.17.0"
59425947
tsconfig-paths "^3.9.0"
59435948

5949+
eslint-plugin-jsdoc@^31.0.3:
5950+
version "31.0.3"
5951+
resolved "https://registry.yarnpkg.com/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-31.0.3.tgz#23dd8bee22421af1dab0a00a91dfc3d47f644a76"
5952+
integrity sha512-O2HXyXyw2FYXWngFGeuCxhmClb4M1Y/w+bPcahO31P/Tw+vHZUU9wkPkSML2izznJ1dp3dnTG4on9bXDZDWfyQ==
5953+
dependencies:
5954+
comment-parser "1.0.1"
5955+
debug "^4.3.1"
5956+
jsdoctypeparser "^9.0.0"
5957+
lodash "^4.17.20"
5958+
regextras "^0.7.1"
5959+
semver "^7.3.4"
5960+
spdx-expression-parse "^3.0.1"
5961+
59445962
eslint-plugin-jsx-a11y@^6.4.1:
59455963
version "6.4.1"
59465964
resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.4.1.tgz#a2d84caa49756942f42f1ffab9002436391718fd"
@@ -8187,6 +8205,11 @@ jsbn@~0.1.0:
81878205
resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513"
81888206
integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM=
81898207

8208+
jsdoctypeparser@^9.0.0:
8209+
version "9.0.0"
8210+
resolved "https://registry.yarnpkg.com/jsdoctypeparser/-/jsdoctypeparser-9.0.0.tgz#8c97e2fb69315eb274b0f01377eaa5c940bd7b26"
8211+
integrity sha512-jrTA2jJIL6/DAEILBEh2/w9QxCuwmvNXIry39Ay/HVfhE3o2yVV0U44blYkqdHA/OKloJEqvJy0xU+GSdE2SIw==
8212+
81908213
jsesc@^2.5.1:
81918214
version "2.5.2"
81928215
resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4"
@@ -11330,6 +11353,11 @@ regexpu-core@^4.7.1:
1133011353
unicode-match-property-ecmascript "^1.0.4"
1133111354
unicode-match-property-value-ecmascript "^1.2.0"
1133211355

11356+
regextras@^0.7.1:
11357+
version "0.7.1"
11358+
resolved "https://registry.yarnpkg.com/regextras/-/regextras-0.7.1.tgz#be95719d5f43f9ef0b9fa07ad89b7c606995a3b2"
11359+
integrity sha512-9YXf6xtW+qzQ+hcMQXx95MOvfqXFgsKDZodX3qZB0x2n5Z94ioetIITsBtvJbiOyxa/6s9AtyweBLCdPmPko/w==
11360+
1133311361
regjsgen@^0.5.1:
1133411362
version "0.5.2"
1133511363
resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.5.2.tgz#92ff295fb1deecbf6ecdab2543d207e91aa33733"
@@ -12095,7 +12123,7 @@ spdx-exceptions@^2.1.0:
1209512123
resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz#3f28ce1a77a00372683eade4a433183527a2163d"
1209612124
integrity sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==
1209712125

12098-
spdx-expression-parse@^3.0.0:
12126+
spdx-expression-parse@^3.0.0, spdx-expression-parse@^3.0.1:
1209912127
version "3.0.1"
1210012128
resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz#cf70f50482eefdc98e3ce0a6833e4a53ceeba679"
1210112129
integrity sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==

0 commit comments

Comments
 (0)