node-editorconfig 1.2.3 → 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 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
- [{.babelrc,bower.json,nodemon.json,*.yml}]
31
+ [{*.yaml,*.yml}]
29
32
  indent_size = 2
30
33
 
31
34
  [Makefile]
@@ -34,10 +37,18 @@ indent_style = tab
34
37
  [{*.json,.node-version,.nvmrc,*.svg}]
35
38
  insert_final_newline = false
36
39
 
37
- [{*.markdown,*.md,*.mdown,*.mkd,*.mkdn,*.text}] # https://superuser.com/questions/249436/file-extension-for-markdown-files/285878#285878
38
- trim_trailing_whitespace = false # https://stackoverflow.com/editing-help#linebreaks
40
+ [{nodemon.json}]
41
+ insert_final_newline = true
42
+
43
+ # [{*.markdown,*.md,*.mdown,*.mkd,*.mkdn,*.text}] # https://superuser.com/questions/249436/file-extension-for-markdown-files/285878#285878
44
+ [{*.md}]
45
+ trim_trailing_whitespace = false # https://stackoverflow.com/editing-help#linebreaks
46
+
47
+ [{*.bat,*.cmd}]
48
+ end_of_line = crlf
39
49
 
40
- [/node_modules/**] # Glob/minimatch pattern to match the "node_modules" directory at the project root
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
41
52
  charset = unset
42
53
  end_of_line = unset
43
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
- 16.14.0
1
+ 20.17.0
@@ -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,42 +1,45 @@
1
1
  {
2
- "name": "node-editorconfig",
3
- "version": "1.2.3",
4
- "description": "A generic .editorconfig for Node JS projects. $ npm i -g node-editorconfig ; node-editorconfig",
5
- "bin": {
6
- "node-editorconfig": "./copy-editorconfig-to-cwd.js"
7
- },
8
- "scripts": {
9
- "lint": "eslint .",
10
- "test": "npm run lint"
11
- },
12
- "repository": {
13
- "type": "git",
14
- "url": "git+https://github.com/webextensions/node-editorconfig.git"
15
- },
16
- "dependencies": {
17
- "cp-file": "^9.1.0"
18
- },
19
- "devDependencies": {
20
- "eslint": "^8.9.0"
21
- },
22
- "keywords": [
23
- "generic",
24
- "setup",
25
- "init",
26
- "initialize",
27
- "default",
28
- "editorconfig",
29
- ".editorconfig",
30
- "node",
31
- "js",
32
- "NodeJS",
33
- "Node.js",
34
- "project"
35
- ],
36
- "author": "Priyank Parashar",
37
- "license": "MIT",
38
- "bugs": {
39
- "url": "https://github.com/webextensions/node-editorconfig/issues"
40
- },
41
- "homepage": "https://github.com/webextensions/node-editorconfig#readme"
2
+ "name": "node-editorconfig",
3
+ "version": "1.4.0",
4
+ "description": "A generic .editorconfig for Node JS projects. $ npm i -g node-editorconfig ; node-editorconfig",
5
+ "engines": {
6
+ "node": ">=18"
7
+ },
8
+ "bin": {
9
+ "node-editorconfig": "./copy-editorconfig-to-cwd.js"
10
+ },
11
+ "scripts": {
12
+ "lint": "eslint .",
13
+ "test": "npm run lint"
14
+ },
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/webextensions/node-editorconfig.git"
18
+ },
19
+ "dependencies": {
20
+ "cp-file": "=9.1.0"
21
+ },
22
+ "devDependencies": {
23
+ "eslint": "=8.57.0"
24
+ },
25
+ "keywords": [
26
+ "generic",
27
+ "setup",
28
+ "init",
29
+ "initialize",
30
+ "default",
31
+ "editorconfig",
32
+ ".editorconfig",
33
+ "node",
34
+ "js",
35
+ "NodeJS",
36
+ "Node.js",
37
+ "project"
38
+ ],
39
+ "author": "Priyank Parashar",
40
+ "license": "MIT",
41
+ "bugs": {
42
+ "url": "https://github.com/webextensions/node-editorconfig/issues"
43
+ },
44
+ "homepage": "https://github.com/webextensions/node-editorconfig#readme"
42
45
  }