diff --git a/configs/.eslintrc.js b/configs/.eslintrc.js index cae558e..91a9890 100644 --- a/configs/.eslintrc.js +++ b/configs/.eslintrc.js @@ -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', @@ -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, @@ -68,12 +81,6 @@ module.exports = { usePrettierrc: true, }, ], - 'no-underscore-dangle': [ - 'error', - { - allow: ['__basedir', '__dirname'], - }, - ], }, extends: ['airbnb-base', 'plugin:prettier/recommended'], plugins: ['no-null'], diff --git a/configs/strict-esm-jsdoc.js b/configs/strict-esm-jsdoc.js new file mode 100644 index 0000000..e0b2581 --- /dev/null +++ b/configs/strict-esm-jsdoc.js @@ -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', + ], + }, + }, +}; diff --git a/configs/strict-jsdoc.js b/configs/strict-jsdoc.js new file mode 100644 index 0000000..0b83a01 --- /dev/null +++ b/configs/strict-jsdoc.js @@ -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', + ], + }, + }, +}; diff --git a/package.json b/package.json index 562d11b..efa9664 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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"