Skip to content

Commit 2ee183f

Browse files
committed
Publish as standalone module
eslint/eslint#14316
1 parent 7bfecb2 commit 2ee183f

File tree

7 files changed

+107
-1
lines changed

7 files changed

+107
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package-lock=false

index.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
declare function formatter(): string;
2+
export = formatter;

license

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
eslint
2+
MIT
3+
Copyright JS Foundation and other contributors, https://js.foundation
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

package.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"name": "eslint-formatter-table",
3+
"version": "7.32.0",
4+
"description": "ESLint’s official `table` formatter, extracted from ESLint 7",
5+
"keywords": [
6+
"lint",
7+
"javascript",
8+
"ecmascript"
9+
],
10+
"repository": "fregante/eslint-formatter-table",
11+
"license": "MIT",
12+
"author": "Nicholas C. Zakas <[email protected]>",
13+
"dependencies": {
14+
"chalk": "^4.0.0",
15+
"table": "^6.0.9"
16+
},
17+
"engines": {
18+
"node": "^10.12.0 || >=12.0.0"
19+
},
20+
"files": [
21+
"index.js",
22+
"index.d.ts"
23+
],
24+
"scripts": {
25+
"test": "mocha"
26+
},
27+
"devDependencies": {
28+
"chai": "^4.3.4",
29+
"mocha": "^9.0.3"
30+
}
31+
}

readme.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# eslint-formatter-table
2+
3+
> ESLint’s official `table` formatter, extracted from ESLint 7
4+
5+
This formatter has been removed from ESLint 8 so it lives as a standalone module here.
6+
7+
**Warning:** This module is not maintained. If you're an ESLint contributor or dependable open-sourcerer, open an issue here and I'll pass you this repo and npm name. You can also ping me on Twitter [@fregante](https://twitter.com/fregante)
8+
9+
## Install
10+
11+
```sh
12+
npm install --save-dev eslint-formatter-table
13+
```
14+
15+
## Usage
16+
17+
More information about formatters can be found on https://eslint.org/docs/user-guide/formatters/
18+
19+
```
20+
eslint --format table
21+
```
22+
23+
## Example output
24+
25+
```
26+
/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js
27+
28+
║ Line │ Column │ Type │ Message │ Rule ID ║
29+
╟──────────┼──────────┼──────────┼────────────────────────────────────────────────────────┼──────────────────────╢
30+
║ 1 │ 10 │ error │ 'addOne' is defined but never used. │ no-unused-vars ║
31+
║ 2 │ 9 │ error │ Use the isNaN function to compare with NaN. │ use-isnan ║
32+
║ 3 │ 16 │ error │ Unexpected space before unary operator '++'. │ space-unary-ops ║
33+
║ 3 │ 20 │ warning │ Missing semicolon. │ semi ║
34+
║ 4 │ 12 │ warning │ Unnecessary 'else' after 'return'. │ no-else-return ║
35+
║ 5 │ 1 │ warning │ Expected indentation of 8 spaces but found 6. │ indent ║
36+
║ 5 │ 7 │ error │ Function 'addOne' expected a return value. │ consistent-return ║
37+
║ 5 │ 13 │ warning │ Missing semicolon. │ semi ║
38+
║ 7 │ 2 │ error │ Unnecessary semicolon. │ no-extra-semi ║
39+
40+
╔════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗
41+
║ 5 Errors ║
42+
╟────────────────────────────────────────────────────────────────────────────────────────────────────────────────╢
43+
║ 4 Warnings ║
44+
╚════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝
45+
```
46+
47+
## Links
48+
49+
- [Other official ESLint formatters as standalone modules](https://github.com/fregante/eslint-formatters)
50+

test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
const assert = require("chai").assert;
1212
const chalk = require("chalk");
13-
const formatter = require("../../../../lib/cli-engine/formatters/table");
13+
const formatter = require(".");
1414

1515
//------------------------------------------------------------------------------
1616
// Tests

0 commit comments

Comments
 (0)