node-editorconfig 1.3.0 → 1.4.1

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 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
- [/node_modules/**] # Glob/minimatch pattern to match the "node_modules" directory at the project root
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
@@ -21,6 +21,8 @@
21
21
  "no-console": "off",
22
22
  "no-debugger": "off",
23
23
  "no-shadow": "off",
24
+ "no-var": "error",
25
+ "prefer-const": "error",
24
26
  "quotes": "off", // http://eslint.org/docs/rules/quotes
25
27
  "semi": [ "error", "always" ]
26
28
  }
package/.nvmrc CHANGED
@@ -1 +1 @@
1
- 18.18.0
1
+ 24
package/README.md CHANGED
@@ -16,7 +16,7 @@ $ npx node-editorconfig
16
16
  $ npm install --global node-editorconfig
17
17
  $ cd /path/to/project/
18
18
  $ node-editorconfig
19
- .editorconfig file added at /path/to/project/.editorconfig
19
+ .editorconfig file added at /path/to/project/.editorconfig
20
20
  ```
21
21
 
22
22
  ## Parameters
@@ -24,7 +24,7 @@ $ node-editorconfig
24
24
  `--overwrite` (To overwrite the .editorconfig file, if it already exists)
25
25
  ```sh
26
26
  $ npx node-editorconfig --overwrite
27
- .editorconfig file overwritten at /path/to/project/.editorconfig
27
+ .editorconfig file overwritten at /path/to/project/.editorconfig
28
28
  ```
29
29
 
30
30
 
@@ -1,23 +1,23 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- var fs = require('fs'),
4
- path = require('path');
3
+ const fs = require('fs');
4
+ const path = require('path');
5
5
 
6
- var cpFile = require('cp-file');
6
+ const cpFile = require('cp-file');
7
7
 
8
- var cwd = process.cwd(),
9
- sourcePath = path.resolve(__dirname, '.editorconfig'),
10
- targetPath = path.resolve(cwd, '.editorconfig');
8
+ const cwd = process.cwd();
9
+ const sourcePath = path.resolve(__dirname, '.editorconfig');
10
+ const targetPath = path.resolve(cwd, '.editorconfig');
11
11
 
12
- var writeToFile = false,
13
- overwriting = false;
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(' .editorconfig file already exists at ' + targetPath);
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(' .editorconfig file overwritten at ' + targetPath);
36
+ console.info(' .editorconfig file overwritten at ' + targetPath);
37
37
  } else {
38
- console.info(' .editorconfig file added at ' + targetPath);
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
- setTimeout(function () {
48
- console.error(e);
49
- console.log('');
50
- }, 750);
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,9 +1,9 @@
1
1
  {
2
2
  "name": "node-editorconfig",
3
- "version": "1.3.0",
3
+ "version": "1.4.1",
4
4
  "description": "A generic .editorconfig for Node JS projects. $ npm i -g node-editorconfig ; node-editorconfig",
5
5
  "engines": {
6
- "node": ">=18"
6
+ "node": ">=20"
7
7
  },
8
8
  "bin": {
9
9
  "node-editorconfig": "./copy-editorconfig-to-cwd.js"
@@ -20,7 +20,7 @@
20
20
  "cp-file": "=9.1.0"
21
21
  },
22
22
  "devDependencies": {
23
- "eslint": "^8.51.0"
23
+ "eslint": "=8.57.1"
24
24
  },
25
25
  "keywords": [
26
26
  "generic",