node-editorconfig 1.3.0 → 1.4.0
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/.editorconfig +10 -4
- package/.eslintrc +2 -0
- package/.nvmrc +1 -1
- package/copy-editorconfig-to-cwd.js +17 -15
- package/package.json +2 -2
package/.editorconfig
CHANGED
|
@@ -13,6 +13,9 @@
|
|
|
13
13
|
# http://editorconfig.org/#download (Plugins)
|
|
14
14
|
# http://davidensinger.com/2013/07/why-i-use-editorconfig/ (Reference)
|
|
15
15
|
# https://github.com/eslint/eslint/blob/master/.editorconfig (Sample file)
|
|
16
|
+
#
|
|
17
|
+
# Further reading:
|
|
18
|
+
# https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties#ideas-for-domain-specific-properties
|
|
16
19
|
|
|
17
20
|
# No .editorconfig files above the root directory
|
|
18
21
|
root = true
|
|
@@ -25,7 +28,7 @@ indent_style = space
|
|
|
25
28
|
insert_final_newline = true
|
|
26
29
|
trim_trailing_whitespace = true
|
|
27
30
|
|
|
28
|
-
[{*.yml}]
|
|
31
|
+
[{*.yaml,*.yml}]
|
|
29
32
|
indent_size = 2
|
|
30
33
|
|
|
31
34
|
[Makefile]
|
|
@@ -37,12 +40,15 @@ insert_final_newline = false
|
|
|
37
40
|
[{nodemon.json}]
|
|
38
41
|
insert_final_newline = true
|
|
39
42
|
|
|
40
|
-
# https://superuser.com/questions/249436/file-extension-for-markdown-files/285878#285878
|
|
41
|
-
# [{*.markdown,*.md,*.mdown,*.mkd,*.mkdn,*.text}]
|
|
43
|
+
# [{*.markdown,*.md,*.mdown,*.mkd,*.mkdn,*.text}] # https://superuser.com/questions/249436/file-extension-for-markdown-files/285878#285878
|
|
42
44
|
[{*.md}]
|
|
43
45
|
trim_trailing_whitespace = false # https://stackoverflow.com/editing-help#linebreaks
|
|
44
46
|
|
|
45
|
-
[
|
|
47
|
+
[{*.bat,*.cmd}]
|
|
48
|
+
end_of_line = crlf
|
|
49
|
+
|
|
50
|
+
# [/node_modules/**] # Glob/minimatch pattern to match the "node_modules" directory only at the project root
|
|
51
|
+
[node_modules/**] # Glob/minimatch pattern to match the "node_modules" directory at any level
|
|
46
52
|
charset = unset
|
|
47
53
|
end_of_line = unset
|
|
48
54
|
indent_size = unset
|
package/.eslintrc
CHANGED
package/.nvmrc
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
20.17.0
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
const cpFile = require('cp-file');
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
const cwd = process.cwd();
|
|
9
|
+
const sourcePath = path.resolve(__dirname, '.editorconfig');
|
|
10
|
+
const targetPath = path.resolve(cwd, '.editorconfig');
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
let writeToFile = false;
|
|
13
|
+
let overwriting = false;
|
|
14
14
|
|
|
15
15
|
if (fs.existsSync(targetPath)) {
|
|
16
16
|
if (process.argv.indexOf('--overwrite') !== -1) {
|
|
17
17
|
writeToFile = true;
|
|
18
18
|
overwriting = true;
|
|
19
19
|
} else {
|
|
20
|
-
console.info('
|
|
20
|
+
console.info(' ✔ .editorconfig file already exists at ' + targetPath);
|
|
21
21
|
console.info(
|
|
22
22
|
'\n Note' +
|
|
23
23
|
'\n ====' +
|
|
@@ -33,9 +33,9 @@ if (writeToFile) {
|
|
|
33
33
|
try {
|
|
34
34
|
cpFile.sync(sourcePath, targetPath);
|
|
35
35
|
if (overwriting) {
|
|
36
|
-
console.info('
|
|
36
|
+
console.info(' ✔ .editorconfig file overwritten at ' + targetPath);
|
|
37
37
|
} else {
|
|
38
|
-
console.info('
|
|
38
|
+
console.info(' ✔ .editorconfig file added at ' + targetPath);
|
|
39
39
|
}
|
|
40
40
|
} catch (e) {
|
|
41
41
|
console.error(
|
|
@@ -44,9 +44,11 @@ if (writeToFile) {
|
|
|
44
44
|
'\n Error details' +
|
|
45
45
|
'\n ============='
|
|
46
46
|
);
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
|
|
48
|
+
console.error(e);
|
|
49
|
+
console.log('');
|
|
50
|
+
|
|
51
|
+
console.error('Aborting with exit code 1');
|
|
52
|
+
process.exit(1);
|
|
51
53
|
}
|
|
52
54
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-editorconfig",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "A generic .editorconfig for Node JS projects. $ npm i -g node-editorconfig ; node-editorconfig",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=18"
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"cp-file": "=9.1.0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"eslint": "
|
|
23
|
+
"eslint": "=8.57.0"
|
|
24
24
|
},
|
|
25
25
|
"keywords": [
|
|
26
26
|
"generic",
|