Skip to content

Commit 33369ff

Browse files
committed
Add module for eslint-plugin-jsdoc
* Add note about ES Modules
1 parent 3d7ddd2 commit 33369ff

File tree

6 files changed

+37
-24
lines changed

6 files changed

+37
-24
lines changed

.eslintrc-base.js

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ module.exports = {
9595
'quote-props': [2, 'consistent'],
9696
'quotes': [2, 'single', { avoidEscape: true, allowTemplateLiterals: true }],
9797
'radix': 2,
98-
'require-jsdoc': [2, { require: { ClassDeclaration: true, MethodDefinition: true } }],
9998
'semi': 2,
10099
'semi-spacing': 2,
101100
'semi-style': 2,
@@ -108,23 +107,6 @@ module.exports = {
108107
'spaced-comment': [2, 'always', { block: { balanced: true }, line: { exceptions: ['/'] } }],
109108
'switch-colon-spacing': 2,
110109
'use-isnan': [2, { enforceForIndexOf: true }],
111-
'valid-jsdoc': [
112-
2,
113-
{
114-
matchDescription: '\\.$',
115-
preferType: {
116-
function: 'Function',
117-
boolean: 'Boolean',
118-
number: 'Number',
119-
integer: 'Number',
120-
int: 'Number',
121-
string: 'String',
122-
object: 'Object'
123-
},
124-
requireParamType: true,
125-
requireReturn: false
126-
}
127-
],
128110
'wrap-iife': [2, 'inside', { functionPrototypeMethods: true }],
129111
'yoda': 2,
130112
}

.eslintrc-jsdoc.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
module.exports = {
2+
rules: {
3+
'jsdoc/check-indentation': 1,
4+
'jsdoc/check-param-names': [1, { checkRestProperty: true }],
5+
'jsdoc/check-syntax': 1,
6+
// 'check-types' casing?
7+
'jsdoc/match-description': 1,
8+
'jsdoc/newline-after-description': 0,
9+
'jsdoc/no-bad-blocks': 1,
10+
'jsdoc/no-defaults': 1,
11+
'jsdoc/require-description': 1,
12+
'jsdoc/require-description-complete-sentence': 1,
13+
'jsdoc/require-jsdoc': [1, { require: { ClassDeclaration: true, MethodDefinition: true } }],
14+
},
15+
};

.eslintrc.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,18 @@ module.exports = {
66
},
77
plugins: [
88
'node',
9-
'jest',
9+
'jsdoc',
1010
],
1111
extends: [
1212
'eslint:recommended',
13-
'.eslintrc-base.js',
14-
'.eslintrc-es6plus.js',
13+
'.eslintrc-base.cjs',
14+
'.eslintrc-es6plus.cjs',
1515
'plugin:node/recommended',
16-
'.eslintrc-node.js',
16+
'.eslintrc-node.cjs',
17+
'plugin:jsdoc/recommended',
18+
'.eslintrc-jsdoc.cjs',
1719
],
1820
env: {
19-
'node': true,
21+
node: true,
2022
},
2123
};

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## 7.16-r1 / 2020-12-29
2+
* [**BREAKING**] JSDoc types are now expected to be lowercase.
3+
*`@param {string} name The name.`
4+
*`@param {String} name The name.`
5+
* Add module for **eslint-plugin-jsdoc**.
6+
* Add note in README about ESLint's ECMAScript Module support.
7+
18
## 7.16-r0 / 2020-12-20
29
* Update rules for ESLint 7.16.
310
* Add module for **eslint-plugin-node**.

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,9 @@ These rules are configured to be used with the following versions.
1717
| `.eslintrc.js` | The root file which includes other modular files. |
1818
| `.eslintrc-base.js` | Includes all rules that don't relate to ES6+ language features. |
1919
| `.eslintrc-es6plus.js` | Includes all rules that relate to ES6+ language features. |
20-
| `.eslintrc-node.js` | Includes rules from [eslint-plugin-node](https://github.com/mysticatea/eslint-plugin-node) removed from ESLint core in [v7.0.0](https://eslint.org/blog/2020/05/eslint-v7.0.0-released).
20+
| `.eslintrc-node.js` | Includes rules from [eslint-plugin-node](https://github.com/mysticatea/eslint-plugin-node) removed from ESLint core in [v7.0.0](https://eslint.org/blog/2020/05/eslint-v7.0.0-released). |
21+
| `.eslintrc-jsdoc.js` | Includes rules from [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) replacing the `require-jsdoc` and `valid-jsdoc` rules deprecated in ESLint core in [v5.10.0](https://eslint.org/blog/2018/12/eslint-v5.10.0-released). |
2122
| `test/.eslintrc.js` | Rules for test files, including Jest-specific rules. |
23+
24+
# ECMAScript Modules
25+
For now, ESLint does not support ES Modules. If your project uses ES Modules, these files will need to be renamed from `*.js` to `*.cjs` so that they still operate in CommonJS style within an ES Modules project. However, `parserOptions.sourceType` will still need to be set to `'module'` so that the linter allows `import` and `export` statements.

test/.eslintrc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
module.exports = {
2+
plugins: [
3+
'jest',
4+
],
25
extends: [
36
'plugin:jest/recommended',
47
'plugin:jest/style',

0 commit comments

Comments
 (0)