@w5s/eslint-config 1.0.0-alpha.36 → 1.0.0-alpha.37
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/ignore.js +1 -1
- package/package.json +6 -5
- package/rules/prettier.js +17 -7
package/ignore.js
CHANGED
|
@@ -7,7 +7,7 @@ const parseGitignore = require('parse-gitignore');
|
|
|
7
7
|
const getGitignore = () => {
|
|
8
8
|
const found = findUp.sync('.gitignore');
|
|
9
9
|
if (found) {
|
|
10
|
-
return parseGitignore(fs.readFileSync(found));
|
|
10
|
+
return parseGitignore.parse(fs.readFileSync(found)).patterns;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
return [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@w5s/eslint-config",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.37",
|
|
4
4
|
"description": "ESLint configuration presets",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
"@rushstack/eslint-patch": "^1.1.0",
|
|
52
52
|
"@typescript-eslint/eslint-plugin": "^5.0.0",
|
|
53
53
|
"@typescript-eslint/parser": "^5.0.0",
|
|
54
|
+
"@w5s/prettier-config": "^1.0.0-alpha.1",
|
|
54
55
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
55
56
|
"eslint-config-prettier": "^8.0.0",
|
|
56
57
|
"eslint-plugin-functional": "^4.2.0",
|
|
@@ -65,7 +66,7 @@
|
|
|
65
66
|
"eslint-plugin-unicorn": "^44.0.0",
|
|
66
67
|
"eslint-plugin-yml": "^1.1.0",
|
|
67
68
|
"find-up": "^5.0.0",
|
|
68
|
-
"parse-gitignore": "^
|
|
69
|
+
"parse-gitignore": "^2.0.0"
|
|
69
70
|
},
|
|
70
71
|
"devDependencies": {
|
|
71
72
|
"@babel/eslint-parser": "7.19.1",
|
|
@@ -73,8 +74,8 @@
|
|
|
73
74
|
"@types/eslint-plugin-prettier": "3.1.0",
|
|
74
75
|
"@types/prettier": "2.7.1",
|
|
75
76
|
"@types/react": "18.0.25",
|
|
76
|
-
"@typescript-eslint/parser": "5.
|
|
77
|
-
"eslint": "8.
|
|
77
|
+
"@typescript-eslint/parser": "5.43.0",
|
|
78
|
+
"eslint": "8.28.0",
|
|
78
79
|
"eslint-config-prettier": "8.5.0",
|
|
79
80
|
"eslint-index": "1.5.0",
|
|
80
81
|
"prettier": "2.7.1",
|
|
@@ -96,5 +97,5 @@
|
|
|
96
97
|
"publishConfig": {
|
|
97
98
|
"access": "public"
|
|
98
99
|
},
|
|
99
|
-
"gitHead": "
|
|
100
|
+
"gitHead": "e6b57fb4d5c15057b66ccef776ec225496b012b7"
|
|
100
101
|
}
|
package/rules/prettier.js
CHANGED
|
@@ -1,15 +1,25 @@
|
|
|
1
1
|
const { error } = require('./_rule.js');
|
|
2
2
|
|
|
3
|
+
// Try require '@w5s/prettier-config'
|
|
4
|
+
const prettierConfig = (() => {
|
|
5
|
+
try {
|
|
6
|
+
// eslint-disable-next-line global-require
|
|
7
|
+
return require('@w5s/prettier-config');
|
|
8
|
+
} catch (error_) {
|
|
9
|
+
// eslint-disable-next-line no-console
|
|
10
|
+
console.warn(error_);
|
|
11
|
+
/** @type {import('@w5s/prettier-config')} */
|
|
12
|
+
const defaultConfig = {
|
|
13
|
+
trailingComma: 'es5',
|
|
14
|
+
};
|
|
15
|
+
return defaultConfig;
|
|
16
|
+
}
|
|
17
|
+
})();
|
|
18
|
+
|
|
3
19
|
module.exports = {
|
|
4
20
|
extends: ['prettier'],
|
|
5
21
|
plugins: ['prettier'],
|
|
6
22
|
rules: {
|
|
7
|
-
'prettier/prettier': [
|
|
8
|
-
error,
|
|
9
|
-
{
|
|
10
|
-
singleQuote: true,
|
|
11
|
-
trailingComma: 'es5',
|
|
12
|
-
},
|
|
13
|
-
],
|
|
23
|
+
'prettier/prettier': [error, prettierConfig],
|
|
14
24
|
},
|
|
15
25
|
};
|