@w5s/eslint-config 3.3.1 → 3.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +160 -144
- package/dist/index.js +16 -11
- package/dist/index.js.map +1 -1
- package/package.json +10 -10
- package/src/config/imports.ts +13 -7
- package/src/config/jsdoc.ts +5 -6
- package/src/type/PluginOptionsBase.ts +2 -0
- package/src/typegen/jsdoc.d.ts +2 -0
- package/src/typegen/unicorn.d.ts +158 -144
package/dist/index.js
CHANGED
|
@@ -6,7 +6,6 @@ import process from 'process';
|
|
|
6
6
|
import { findUp } from 'find-up';
|
|
7
7
|
import parseGitignore from 'parse-gitignore';
|
|
8
8
|
import prettierConfig from '@w5s/prettier-config';
|
|
9
|
-
import importPlugin from 'eslint-plugin-import';
|
|
10
9
|
|
|
11
10
|
var __create = Object.create;
|
|
12
11
|
var __defProp = Object.defineProperty;
|
|
@@ -1240,9 +1239,7 @@ var StylisticConfig = {
|
|
|
1240
1239
|
|
|
1241
1240
|
// src/config/jsdoc.ts
|
|
1242
1241
|
async function jsdoc(options = {}) {
|
|
1243
|
-
const [jsdocPlugin] = await Promise.all([
|
|
1244
|
-
interopDefault(import('eslint-plugin-jsdoc'))
|
|
1245
|
-
]);
|
|
1242
|
+
const [jsdocPlugin] = await Promise.all([interopDefault(import('eslint-plugin-jsdoc'))]);
|
|
1246
1243
|
const { rules = {}, stylistic: stylistic2 = true } = options;
|
|
1247
1244
|
const { enabled: stylisticEnabled } = StylisticConfig.from(stylistic2);
|
|
1248
1245
|
return [
|
|
@@ -1255,21 +1252,22 @@ async function jsdoc(options = {}) {
|
|
|
1255
1252
|
{
|
|
1256
1253
|
name: "w5s/jsdoc/rules",
|
|
1257
1254
|
rules: {
|
|
1258
|
-
...jsdocPlugin.configs["flat/recommended"].rules,
|
|
1255
|
+
...jsdocPlugin.configs["flat/recommended-typescript-flavor"].rules,
|
|
1259
1256
|
"jsdoc/no-undefined-types": "off",
|
|
1260
1257
|
// https://github.com/gajus/eslint-plugin-jsdoc/issues/839
|
|
1261
1258
|
"jsdoc/require-hyphen-before-param-description": ["warn", "always"],
|
|
1262
1259
|
"jsdoc/require-jsdoc": "off",
|
|
1263
1260
|
"jsdoc/require-param-description": "off",
|
|
1261
|
+
"jsdoc/require-param-type": "off",
|
|
1264
1262
|
"jsdoc/require-returns": "off",
|
|
1265
|
-
"jsdoc/tag-lines": ["warn", "any", { startLines: 1 }],
|
|
1266
1263
|
"jsdoc/valid-types": "off",
|
|
1267
1264
|
// FIXME: reports lots of false positive
|
|
1268
1265
|
// 'strict': ['error', 'safe'],
|
|
1269
1266
|
...stylisticEnabled ? {
|
|
1270
|
-
|
|
1267
|
+
...jsdocPlugin.configs["flat/stylistic-typescript"].rules,
|
|
1271
1268
|
"jsdoc/check-alignment": "warn",
|
|
1272
|
-
"jsdoc/multiline-blocks": "warn"
|
|
1269
|
+
"jsdoc/multiline-blocks": "warn",
|
|
1270
|
+
"jsdoc/tag-lines": ["warn", "any", { startLines: 1 }]
|
|
1273
1271
|
} : {},
|
|
1274
1272
|
...rules
|
|
1275
1273
|
},
|
|
@@ -1517,18 +1515,25 @@ function sortPackageJson() {
|
|
|
1517
1515
|
}
|
|
1518
1516
|
};
|
|
1519
1517
|
}
|
|
1520
|
-
var importConfig = importPlugin.flatConfigs["recommended"];
|
|
1521
1518
|
async function imports(options = {}) {
|
|
1522
1519
|
const { rules = {}, stylistic: stylistic2 = true } = options;
|
|
1523
1520
|
const { enabled: stylisticEnabled } = StylisticConfig.from(stylistic2);
|
|
1521
|
+
const [importPlugin] = await Promise.all([interopDefault(import('eslint-plugin-import'))]);
|
|
1524
1522
|
return [
|
|
1525
1523
|
{
|
|
1526
1524
|
name: "w5s/import/rules",
|
|
1527
|
-
plugins:
|
|
1525
|
+
plugins: {
|
|
1526
|
+
import: importPlugin
|
|
1527
|
+
},
|
|
1528
1528
|
rules: {
|
|
1529
|
-
|
|
1529
|
+
// 'import/consistent-type-specifier-style': ['error', 'prefer-inline'],
|
|
1530
|
+
"import/first": "error",
|
|
1531
|
+
"import/no-duplicates": "error",
|
|
1532
|
+
"import/no-mutable-exports": "error",
|
|
1533
|
+
"import/no-named-default": "error",
|
|
1530
1534
|
...stylisticEnabled ? {
|
|
1531
1535
|
// Stylistic rules
|
|
1536
|
+
"import/newline-after-import": ["error", { count: 1 }]
|
|
1532
1537
|
} : {},
|
|
1533
1538
|
...rules
|
|
1534
1539
|
}
|