align-spaces 1.0.3 → 2.0.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/ChangeLog CHANGED
@@ -1,3 +1,37 @@
1
+ 2025.02.09, v2.0.0
2
+
3
+ feature:
4
+ - 60bd85c align-spaces: drop support of node < 18
5
+ - 0f575d8 align-spaces: eslint-plugin-n v17.15.1
6
+ - c33fd25 align-spaces: eslint-plugin-putout v24.0.1
7
+ - ba856e7 align-spaces: eslint v9.20.0
8
+ - 7ef515c align-spaces: madrun v10.2.4
9
+ - 1b1871a align-spaces: nodemon v3.1.9
10
+ - abb8ddd align-spaces: c8 v10.1.3
11
+ - a100cec align-spaces: putout v38.0.9
12
+ - 66cea8e align-spaces: supertape v10.10.0
13
+ - 0a4942b (package) supertape v2.0.1
14
+ - a805089 (package) putout v9.1.0
15
+ - a0a1644 (package) madrun v7.0.0
16
+ - 43e7ec8 (package) eslint-plugin-putout v5.0.1
17
+ - 224c1a5 (package) eslint v7.3.1
18
+ - 1853e0c (package) try-catch v3.0.0
19
+
20
+ 2020.02.24, v1.0.4
21
+
22
+ feature:
23
+ - (package) eslint-plugin-node v11.0.0
24
+ - (package) nodemon v2.0.2
25
+ - (package) nyc v15.0.0
26
+ - (package) putout v7.13.1
27
+ - (package) eslint-plugin-putout v3.2.1
28
+ - (package) madrun v5.4.2
29
+ - (package) eslint v6.0.0-rc.0
30
+ - (madrun) add
31
+ - (package) nyc v14.1.1
32
+ - (package) eslint-plugin-node v9.1.0
33
+
34
+
1
35
  2019.01.21, v1.0.3
2
36
 
3
37
  fix:
package/README.md CHANGED
@@ -1,14 +1,11 @@
1
- # Align Spaces [![NPM version][NPMIMGURL]][NPMURL] [![Dependency Status][DependencyStatusIMGURL]][DependencyStatusURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Coverage Status][CoverageIMGURL]][CoverageURL]
1
+ # Align Spaces [![NPM version][NPMIMGURL]][NPMURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Coverage Status][CoverageIMGURL]][CoverageURL]
2
2
 
3
- [NPMIMGURL]: https://img.shields.io/npm/v/align-spaces.svg?style=flat&longCache=true
4
- [BuildStatusIMGURL]: https://img.shields.io/travis/coderaiser/align-spaces/master.svg?style=flat&longCache=true
5
- [DependencyStatusIMGURL]: https://img.shields.io/david/coderaiser/align-spaces.svg?style=flat&longCache=true
6
- [NPMURL]: https://npmjs.org/package/align-spaces "npm"
7
- [BuildStatusURL]: https://travis-ci.org/coderaiser/align-spaces "Build Status"
8
- [DependencyStatusURL]: https://david-dm.org/coderaiser/align-spaces "Dependency Status"
9
-
10
- [CoverageURL]: https://coveralls.io/github/coderaiser/align-spaces?branch=master
11
- [CoverageIMGURL]: https://coveralls.io/repos/coderaiser/align-spaces/badge.svg?branch=master&service=github
3
+ [NPMIMGURL]: https://img.shields.io/npm/v/align-spaces.svg?style=flat&longCache=true
4
+ [NPMURL]: https://npmjs.org/package/align-spaces "npm"
5
+ [BuildStatusURL]: https://github.com/coderaiser/align-spaces/actions?query=workflow%3A%22Node+CI%22 "Build Status"
6
+ [BuildStatusIMGURL]: https://github.com/coderaiser/align-spaces/workflows/Node%20CI/badge.svg
7
+ [CoverageURL]: https://coveralls.io/github/coderaiser/align-spaces?branch=master
8
+ [CoverageIMGURL]: https://coveralls.io/repos/coderaiser/align-spaces/badge.svg?branch=master&service=github
12
9
 
13
10
  Align spaces on empty lines of a source code.
14
11
 
@@ -36,29 +33,28 @@ const t = 'hello';
36
33
 
37
34
  module.exports = () => {
38
35
  cosnt m = 'world';
39
-
36
+
40
37
  return t + m;
41
38
  };
42
- `
43
39
  `);
40
+
44
41
  // returns
45
42
  `
46
43
  const t = 'hello';
47
44
 
48
45
  module.exports = () => {
49
46
  cosnt m = 'world';
50
-
47
+ ....
51
48
  return t + m;
52
49
  };
53
- `
50
+ `;
54
51
  ```
55
52
 
56
53
  ## Related
57
54
 
58
55
  - [eslint-remove-line](https://github.com/coderaiser/eslint-remove-line) - `eslint --fix` for [unused variables](https://eslint.org/docs/rules/no-unused-vars).
59
- - [putout](https://github.com/coderaiser/putout) - find and remove unused variables.
56
+ - [putout](https://github.com/coderaiser/putout) - the pluggable code transformer.
60
57
 
61
58
  ## License
62
59
 
63
60
  MIT
64
-
@@ -2,15 +2,18 @@
2
2
 
3
3
  'use strict';
4
4
 
5
+ const process = require('node:process');
5
6
  const [name] = process.argv.slice(2);
6
7
 
7
- if (!name)
8
- return console.log('align-spaces <filename>');
8
+ if (!name) {
9
+ console.log('align-spaces <filename>');
10
+ process.exit();
11
+ }
12
+
13
+ const fs = require('node:fs');
9
14
 
10
- const fs = require('fs');
11
15
  const alignSpaces = require('..');
12
16
 
13
17
  const str = fs.readFileSync(name, 'utf8');
14
18
 
15
19
  fs.writeFileSync(name, alignSpaces(str));
16
-
@@ -1,5 +1,7 @@
1
1
  'use strict';
2
2
 
3
+ const isString = (a) => typeof a === 'string';
4
+
3
5
  module.exports = (str) => {
4
6
  check(str);
5
7
 
@@ -46,7 +48,6 @@ function getSpaces(s) {
46
48
  }
47
49
 
48
50
  function check(str) {
49
- if (typeof str !== 'string')
51
+ if (!isString(str))
50
52
  throw Error('str should be a string!');
51
53
  }
52
-
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "align-spaces",
3
- "version": "1.0.3",
3
+ "version": "2.0.0",
4
+ "type": "commonjs",
4
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
5
6
  "description": "align spaces on empty lines of a source code",
6
7
  "homepage": "http://github.com/coderaiser/align-spaces",
@@ -10,35 +11,38 @@
10
11
  },
11
12
  "repository": {
12
13
  "type": "git",
13
- "url": "git://github.com/coderaiser/align-spaces.git"
14
+ "url": "git+https://github.com/coderaiser/align-spaces.git"
14
15
  },
15
16
  "scripts": {
16
- "test": "tape 'test/*.js'",
17
- "watch:test": "nodemon -w lib -w test -x \"npm test\"",
18
- "lint": "redrun lint:*",
19
- "lint:bin": "eslint bin --rule 'no-console:0' bin",
20
- "lint:lib": "eslint lib test/*.js",
21
- "coverage": "nyc npm test",
22
- "report": "nyc report --reporter=text-lcov | coveralls || true"
17
+ "test": "madrun test",
18
+ "watch:test": "madrun watch:test",
19
+ "lint": "madrun lint",
20
+ "putout": "madrun putout",
21
+ "lint:bin": "madrun lint:bin",
22
+ "lint:lib": "madrun lint:lib",
23
+ "fix:lint": "madrun fix:lint",
24
+ "coverage": "madrun coverage",
25
+ "report": "madrun report"
23
26
  },
24
27
  "dependencies": {},
25
28
  "keywords": [
26
29
  "align-whitespaces"
27
30
  ],
28
31
  "devDependencies": {
29
- "@putout/eslint-config": "^1.1.0",
32
+ "c8": "^10.1.3",
30
33
  "coveralls": "^3.0.0",
31
- "eslint": "^5.6.0",
32
- "eslint-plugin-node": "^8.0.0",
33
- "nodemon": "^1.14.12",
34
- "nyc": "^13.0.1",
35
- "redrun": "^7.0.2",
36
- "supertape": "^1.2.0",
37
- "try-catch": "^2.0.0"
34
+ "eslint": "^9.20.0",
35
+ "eslint-plugin-n": "^17.15.1",
36
+ "eslint-plugin-putout": "^24.0.1",
37
+ "madrun": "^10.2.4",
38
+ "nodemon": "^3.1.9",
39
+ "putout": "^38.0.9",
40
+ "supertape": "^10.10.0",
41
+ "try-catch": "^3.0.0"
38
42
  },
39
43
  "license": "MIT",
40
44
  "engines": {
41
- "node": ">=8.3.0"
45
+ "node": ">=18"
42
46
  },
43
47
  "publishConfig": {
44
48
  "access": "public"