Skip to content

Commit d9053b6

Browse files
committed
chore: better enforce line break styles
1 parent ae84993 commit d9053b6

File tree

6 files changed

+315
-23
lines changed

6 files changed

+315
-23
lines changed

.editorconfig

-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,3 @@ insert_final_newline = true
1616
indent_style = space
1717
indent_size = 2
1818

19-
[Gruntfile.js]
20-
indent_style = space
21-
indent_size = 2
22-

.gitattributes

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
# Auto detect text files and perform LF normalization
2-
* text=auto
3-
2+
* text=auto eol=lf

.vscode/settings.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"files.eol": "\n"
3+
}

eslint.config.mjs

+17-13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// eslint.config.js
21
import jsdoc from "eslint-plugin-jsdoc";
2+
import stylistic from "@stylistic/eslint-plugin"
33

44
export default [
55
{
@@ -20,25 +20,18 @@ export default [
2020
},
2121
files: ["src/**/*.js"],
2222
plugins: {
23-
jsdoc
23+
jsdoc,
24+
'@stylistic': stylistic
2425
},
2526
rules: {
2627
// http://eslint.org/docs/rules/
2728
"accessor-pairs": "error",
2829
"array-callback-return": "error",
2930
"arrow-body-style": ["error", "as-needed"],
30-
"arrow-spacing": ["error", { "before": true, "after": true }],
31-
"block-spacing": ["error", "always"],
3231
"block-scoped-var": "error",
33-
"brace-style": ["off", "1tbs", { "allowSingleLine": true }],
3432
"camelcase": ["off", { "properties": "never" }],
35-
"comma-dangle": ["error", "never"],
36-
"comma-spacing": ["error", { "before": false, "after": true }],
37-
"comma-style": ["error", "last"],
3833
"constructor-super": "error",
3934
"curly": ["error", "multi-line"],
40-
"dot-location": ["error", "property"],
41-
"eol-last": "error",
4235
"eqeqeq": ["error", "allow-null"],
4336
"func-call-spacing": ["error", "never"],
4437
"for-direction": "error",
@@ -114,7 +107,6 @@ export default [
114107
"prefer-arrow-callback" : "error",
115108
"quotes": ["error", "double", { "avoidEscape": true, "allowTemplateLiterals": true }],
116109
"rest-spread-spacing": ["error", "never"],
117-
"semi": ["error", "always"],
118110
"semi-spacing": ["error", { "before": false, "after": true }],
119111
"space-before-blocks": ["error", "always"],
120112
"space-before-function-paren": ["off", "always"],
@@ -128,7 +120,19 @@ export default [
128120
"yield-star-spacing": ["error", "both"],
129121
"yoda": ["error", "never"],
130122
"jsdoc/require-hyphen-before-param-description": "error",
131-
"jsdoc/no-undefined-types" : "off"
123+
"jsdoc/no-undefined-types" : "off",
124+
125+
// https://eslint.style/rules
126+
"@stylistic/arrow-spacing": ["error", { "before": true, "after": true }],
127+
"@stylistic/block-spacing": ["error", "always"],
128+
"@stylistic/brace-style": ["off", "1tbs", { "allowSingleLine": true }],
129+
"@stylistic/comma-dangle": ["error", "never"],
130+
"@stylistic/comma-spacing": ["error", { "before": false, "after": true }],
131+
"@stylistic/comma-style": ["error", "last"],
132+
"@stylistic/semi": ["error", "always"],
133+
"@stylistic/dot-location": ["error", "property"],
134+
"@stylistic/eol-last": ["error"],
135+
"@stylistic/linebreak-style": ["error", "unix"]
132136
}
133137
}
134-
];
138+
];

0 commit comments

Comments
 (0)