Skip to content

Commit

Permalink
feat: strict jsdoc config available (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiTenno authored Feb 8, 2024
1 parent 10f5e57 commit 8a6ed14
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 9 deletions.
23 changes: 15 additions & 8 deletions configs/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,21 @@ module.exports = {
],
strict: ['error', 'safe'],
'linebreak-style': ['error', 'unix'],
'no-await-in-loop': 'off',
'func-names': 0,
'arrow-parens': ['error', 'always'],
'global-require': 0,
'no-await-in-loop': 'off',
'no-param-reassign': 'off',
'no-continue': 'off',
'lines-between-class-members': 'off',
'no-underscore-dangle': [
'error',
{
allow: ['__basedir', '__dirname'],
},
],
'no-fallthrough': 'off',
'no-case-declarations': 'off',
'lines-between-class-members': 'off',
'default-case': 'off',
'max-classes-per-file': 'off',
'consistent-return': 'off',
Expand All @@ -52,6 +58,13 @@ module.exports = {
'error',
{ devDependencies: ['**/*.test.{js,cjs,mjs}', '**/*.spec.{js,cjs,mjs}', 'build/**/*.{js,cjs,mjs}'] },
],
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
'newlines-between': 'always',
},
],
'no-null/no-null': 2,
quotes: [
2,
Expand All @@ -68,12 +81,6 @@ module.exports = {
usePrettierrc: true,
},
],
'no-underscore-dangle': [
'error',
{
allow: ['__basedir', '__dirname'],
},
],
},
extends: ['airbnb-base', 'plugin:prettier/recommended'],
plugins: ['no-null'],
Expand Down
23 changes: 23 additions & 0 deletions configs/strict-esm-jsdoc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
'use strict';

module.exports = {
rules: {
'valid-jsdoc': ['off'],
},
extends: ['@wfcd/eslint-config/esm', 'plugin:jsdoc/recommended-typescript-flavor-error'],
parser: '@babel/eslint-parser',
parserOptions: {
sourceType: 'module',
ecmaVersion: 6,
ecmaFeatures: {
modules: true,
},
babelOptions: {
plugins: [
'@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-private-methods',
'@babel/plugin-syntax-import-assertions',
],
},
},
};
19 changes: 19 additions & 0 deletions configs/strict-jsdoc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
'use strict';

module.exports = {
rules: {
'valid-jsdoc': ['off'],
},
extends: ['@wfcd', 'plugin:jsdoc/recommended-typescript-flavor-error'],
parser: '@babel/eslint-parser',
parserOptions: {
ecmaVersion: 6,
babelOptions: {
plugins: [
'@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-private-methods',
'@babel/plugin-syntax-import-assertions',
],
},
},
};
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
".": "./configs/.eslintrc.js",
"./esm": "./configs/esm.js",
"./prettier": "./configs/prettier.config.js",
"./typescript": "./configs/typescript.js"
"./typescript": "./configs/typescript.js",
"./strict-jsdoc": "./configs/strict-jsdoc.js",
"./strict-esm-jsdoc": "./configs/strict-esm-jsdoc.js"
},
"peerDependencies": {
"@babel/core": "^7.19.1",
Expand All @@ -43,6 +45,7 @@
"eslint-config-prettier": "^8.5.0",
"eslint-config-airbnb-typescript": "17.0.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsdoc": "^48.0.6",
"eslint-plugin-no-null": "^1.0.2",
"eslint-plugin-prettier": "^4.2.1",
"prettier": "^2.7.1"
Expand Down

0 comments on commit 8a6ed14

Please sign in to comment.