@w5s/eslint-config 1.0.7 → 1.0.9
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/lib/es/jsdoc.js +1 -0
- package/lib/ignore.js +10 -4
- package/package.json +3 -3
- package/src/es/jsdoc.ts +1 -0
- package/src/ignore.ts +10 -5
package/lib/es/jsdoc.js
CHANGED
package/lib/ignore.js
CHANGED
|
@@ -5,10 +5,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
const node_fs_1 = require("node:fs");
|
|
6
6
|
const find_up_1 = __importDefault(require("find-up"));
|
|
7
7
|
const parse_gitignore_1 = __importDefault(require("parse-gitignore"));
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
const node_path_1 = require("node:path");
|
|
9
|
+
const getGitignore = (prefix = '') => {
|
|
10
|
+
const cwd = process.cwd();
|
|
11
|
+
const gitIgnoreFile = find_up_1.default.sync((0, node_path_1.join)(prefix, '.gitignore'), { cwd });
|
|
12
|
+
if (gitIgnoreFile != null) {
|
|
13
|
+
const { patterns } = parse_gitignore_1.default.parse((0, node_fs_1.readFileSync)(gitIgnoreFile));
|
|
14
|
+
const returnValue = patterns.map((pattern) => (0, node_path_1.join)(prefix, pattern));
|
|
15
|
+
return returnValue;
|
|
12
16
|
}
|
|
13
17
|
return [];
|
|
14
18
|
};
|
|
@@ -35,6 +39,8 @@ const config = {
|
|
|
35
39
|
'_generated_/',
|
|
36
40
|
'*.toml',
|
|
37
41
|
...getGitignore(),
|
|
42
|
+
...getGitignore('android'),
|
|
43
|
+
...getGitignore('ios'),
|
|
38
44
|
],
|
|
39
45
|
};
|
|
40
46
|
module.exports = config;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@w5s/eslint-config",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"description": "ESLint configuration presets",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"eslint-config-prettier": "^8.0.0",
|
|
60
60
|
"eslint-plugin-import": "^2.25.0",
|
|
61
61
|
"eslint-plugin-jest": "^27.0.0",
|
|
62
|
-
"eslint-plugin-jsdoc": "^
|
|
62
|
+
"eslint-plugin-jsdoc": "^44.1.0",
|
|
63
63
|
"eslint-plugin-jsonc": "^2.4.0",
|
|
64
64
|
"eslint-plugin-prettier": "^4.0.0",
|
|
65
65
|
"eslint-plugin-promise": "^6.0.0",
|
|
@@ -102,5 +102,5 @@
|
|
|
102
102
|
"publishConfig": {
|
|
103
103
|
"access": "public"
|
|
104
104
|
},
|
|
105
|
-
"gitHead": "
|
|
105
|
+
"gitHead": "b37ce0baef125aef752089cf90b5a75a4356f678"
|
|
106
106
|
}
|
package/src/es/jsdoc.ts
CHANGED
|
@@ -9,6 +9,7 @@ const config: eslint.Linter.Config = {
|
|
|
9
9
|
'jsdoc/require-jsdoc': 'off',
|
|
10
10
|
'jsdoc/require-param-description': 'off',
|
|
11
11
|
'jsdoc/require-returns': 'off',
|
|
12
|
+
'jsdoc/tag-lines': ['warn', 'any', { startLines: 1 }],
|
|
12
13
|
'jsdoc/valid-types': 'off', // FIXME: reports lots of false positive
|
|
13
14
|
strict: ['error', 'safe'],
|
|
14
15
|
},
|
package/src/ignore.ts
CHANGED
|
@@ -2,13 +2,16 @@ import type eslint from 'eslint';
|
|
|
2
2
|
import { readFileSync } from 'node:fs';
|
|
3
3
|
import findUp from 'find-up';
|
|
4
4
|
import parseGitignore from 'parse-gitignore';
|
|
5
|
+
import { join as pathJoin } from 'node:path';
|
|
5
6
|
|
|
6
|
-
const getGitignore = () => {
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
const getGitignore = (prefix = '') => {
|
|
8
|
+
const cwd = process.cwd();
|
|
9
|
+
const gitIgnoreFile = findUp.sync(pathJoin(prefix, '.gitignore'), { cwd });
|
|
10
|
+
if (gitIgnoreFile != null) {
|
|
11
|
+
const { patterns } = parseGitignore.parse(readFileSync(gitIgnoreFile));
|
|
12
|
+
const returnValue = patterns.map((pattern) => pathJoin(prefix, pattern));
|
|
13
|
+
return returnValue;
|
|
10
14
|
}
|
|
11
|
-
|
|
12
15
|
return [];
|
|
13
16
|
};
|
|
14
17
|
|
|
@@ -35,6 +38,8 @@ const config: eslint.Linter.Config = {
|
|
|
35
38
|
'_generated_/',
|
|
36
39
|
'*.toml',
|
|
37
40
|
...getGitignore(),
|
|
41
|
+
...getGitignore('android'),
|
|
42
|
+
...getGitignore('ios'),
|
|
38
43
|
],
|
|
39
44
|
};
|
|
40
45
|
|