@blueking/eslint-config-bk 2.1.0-beta.6 → 2.1.0-beta.9

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.
Files changed (2) hide show
  1. package/bin/index.js +22 -0
  2. package/package.json +4 -1
package/bin/index.js ADDED
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { ESLint } = require("eslint");
4
+ console.log(process.argv)
5
+
6
+ (async function main() {
7
+ // 1. Create an instance.
8
+ const eslint = new ESLint();
9
+
10
+ // 2. Lint files.
11
+ const results = await eslint.lintFiles(["lib/**/*.js"]);
12
+
13
+ // 3. Format the results.
14
+ const formatter = await eslint.loadFormatter("stylish");
15
+ const resultText = formatter.format(results);
16
+
17
+ // 4. Output it.
18
+ console.log(resultText);
19
+ })().catch((error) => {
20
+ process.exitCode = 1;
21
+ console.error(error);
22
+ });
package/package.json CHANGED
@@ -1,7 +1,10 @@
1
1
  {
2
2
  "name": "@blueking/eslint-config-bk",
3
- "version": "2.1.0-beta.06",
3
+ "version": "2.1.0-beta.09",
4
4
  "main": "index.js",
5
+ "bin": {
6
+ "eslint-config-bk": "./bin/index.js"
7
+ },
5
8
  "dependencies": {
6
9
  "@babel/eslint-parser": "^7.14.3",
7
10
  "@typescript-eslint/eslint-plugin": "~5.20.0",