From 2ee183f9fac9009d87765b199bf4d2cbc30134c5 Mon Sep 17 00:00:00 2001 From: Federico Date: Tue, 3 Aug 2021 18:50:00 +0700 Subject: [PATCH] Publish as standalone module https://github.com/eslint/eslint/pull/14316 --- .gitignore | 1 + .npmrc | 1 + index.d.ts | 2 ++ license | 21 +++++++++++++++++++++ package.json | 31 +++++++++++++++++++++++++++++++ readme.md | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ test.js | 2 +- 7 files changed, 107 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 .npmrc create mode 100755 index.d.ts create mode 100755 license create mode 100755 package.json create mode 100755 readme.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..43c97e7 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +package-lock=false diff --git a/index.d.ts b/index.d.ts new file mode 100755 index 0000000..8635140 --- /dev/null +++ b/index.d.ts @@ -0,0 +1,2 @@ +declare function formatter(): string; +export = formatter; diff --git a/license b/license new file mode 100755 index 0000000..144b096 --- /dev/null +++ b/license @@ -0,0 +1,21 @@ +eslint +MIT +Copyright JS Foundation and other contributors, https://js.foundation + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/package.json b/package.json new file mode 100755 index 0000000..d19ff78 --- /dev/null +++ b/package.json @@ -0,0 +1,31 @@ +{ + "name": "eslint-formatter-table", + "version": "7.32.0", + "description": "ESLint’s official `table` formatter, extracted from ESLint 7", + "keywords": [ + "lint", + "javascript", + "ecmascript" + ], + "repository": "fregante/eslint-formatter-table", + "license": "MIT", + "author": "Nicholas C. Zakas ", + "dependencies": { + "chalk": "^4.0.0", + "table": "^6.0.9" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "scripts": { + "test": "mocha" + }, + "devDependencies": { + "chai": "^4.3.4", + "mocha": "^9.0.3" + } +} diff --git a/readme.md b/readme.md new file mode 100755 index 0000000..3ce55b7 --- /dev/null +++ b/readme.md @@ -0,0 +1,50 @@ +# eslint-formatter-table + +> ESLint’s official `table` formatter, extracted from ESLint 7 + +This formatter has been removed from ESLint 8 so it lives as a standalone module here. + +**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) + +## Install + +```sh +npm install --save-dev eslint-formatter-table +``` + +## Usage + +More information about formatters can be found on https://eslint.org/docs/user-guide/formatters/ + +``` +eslint --format table +``` + +## Example output + +``` +/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js + +║ Line │ Column │ Type │ Message │ Rule ID ║ +╟──────────┼──────────┼──────────┼────────────────────────────────────────────────────────┼──────────────────────╢ +║ 1 │ 10 │ error │ 'addOne' is defined but never used. │ no-unused-vars ║ +║ 2 │ 9 │ error │ Use the isNaN function to compare with NaN. │ use-isnan ║ +║ 3 │ 16 │ error │ Unexpected space before unary operator '++'. │ space-unary-ops ║ +║ 3 │ 20 │ warning │ Missing semicolon. │ semi ║ +║ 4 │ 12 │ warning │ Unnecessary 'else' after 'return'. │ no-else-return ║ +║ 5 │ 1 │ warning │ Expected indentation of 8 spaces but found 6. │ indent ║ +║ 5 │ 7 │ error │ Function 'addOne' expected a return value. │ consistent-return ║ +║ 5 │ 13 │ warning │ Missing semicolon. │ semi ║ +║ 7 │ 2 │ error │ Unnecessary semicolon. │ no-extra-semi ║ + +╔════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗ +║ 5 Errors ║ +╟────────────────────────────────────────────────────────────────────────────────────────────────────────────────╢ +║ 4 Warnings ║ +╚════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝ +``` + +## Links + +- [Other official ESLint formatters as standalone modules](https://github.com/fregante/eslint-formatters) + diff --git a/test.js b/test.js index 3e29caf..3efa7c7 100644 --- a/test.js +++ b/test.js @@ -10,7 +10,7 @@ const assert = require("chai").assert; const chalk = require("chalk"); -const formatter = require("../../../../lib/cli-engine/formatters/table"); +const formatter = require("."); //------------------------------------------------------------------------------ // Tests