@jpp-toolkit/plugin-lint 0.0.15 → 0.0.16

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/dist/index.mjs CHANGED
@@ -57,10 +57,7 @@ var LintCommand = class LintCommand extends Command {
57
57
  else this.logger.success(`ESLint ${mode} completed successfully.`);
58
58
  this.logger.log();
59
59
  if (!prettierResult.failed && !eslintResult.failed) this.logger.success(`Linting process completed successfully.`);
60
- else {
61
- this.logger.error(`Linting process encountered issues.`);
62
- this.exit(1);
63
- }
60
+ else this.fatalError(`Linting process encountered issues.`);
64
61
  }
65
62
  };
66
63
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/lint-command.ts","../src/index.ts"],"sourcesContent":["import { Command } from '@jpp-toolkit/core';\nimport { buildEslintArgs, buildPrettierArgs, findProjectRoot } from '@jpp-toolkit/utils';\nimport { Flags } from '@oclif/core';\nimport { execa } from 'execa';\n\nexport class LintCommand extends Command {\n static override summary = 'Run code linting on the project source code.';\n\n static override flags = {\n format: Flags.boolean({\n char: 'f',\n description: 'Automatically fix linting issues.',\n default: false,\n }),\n root: Flags.boolean({\n char: 'R',\n description: 'Lint from the project root directory.',\n default: false,\n }),\n };\n\n static override examples = [\n {\n description: 'Run the lint command.',\n command: '<%= config.bin %> <%= command.id %>',\n },\n {\n description: 'Run the lint command and automatically fix issues.',\n command: '<%= config.bin %> <%= command.id %> --format',\n },\n {\n description: 'Run the lint command from the project root directory.',\n command: '<%= config.bin %> <%= command.id %> --root',\n },\n ];\n\n public async run(): Promise<void> {\n const { flags } = await this.parse(LintCommand);\n\n const cwd = flags.root ? findProjectRoot() : process.cwd();\n const mode = flags.format ? 'formatting' : 'linting';\n\n this.logger.info(`Running Prettier ${mode}...`);\n const prettierResult = await execa(\n 'prettier',\n buildPrettierArgs({ format: flags.format }),\n {\n cwd,\n stdio: 'inherit',\n preferLocal: true,\n reject: false,\n },\n );\n if (prettierResult.failed) this.logger.error(`Prettier ${mode} failed.`);\n else this.logger.success(`Prettier ${mode} completed successfully.`);\n this.logger.log();\n\n this.logger.info(`Running ESLint ${mode}...`);\n const eslintResult = await execa('eslint', buildEslintArgs({ format: flags.format }), {\n cwd,\n stdio: 'inherit',\n preferLocal: true,\n reject: false,\n });\n if (eslintResult.failed) this.logger.error(`ESLint ${mode} failed.`);\n else this.logger.success(`ESLint ${mode} completed successfully.`);\n this.logger.log();\n\n if (!prettierResult.failed && !eslintResult.failed) {\n this.logger.success(`Linting process completed successfully.`);\n } else {\n this.logger.error(`Linting process encountered issues.`);\n this.exit(1);\n }\n }\n}\n","import { LintCommand } from './lint-command';\n\nexport const commands = {\n lint: LintCommand,\n};\n"],"mappings":";;;;;;AAKA,IAAa,cAAb,MAAa,oBAAoB,QAAQ;CACrC,OAAgB,UAAU;CAE1B,OAAgB,QAAQ;EACpB,QAAQ,MAAM,QAAQ;GAClB,MAAM;GACN,aAAa;GACb,SAAS;GACZ,CAAC;EACF,MAAM,MAAM,QAAQ;GAChB,MAAM;GACN,aAAa;GACb,SAAS;GACZ,CAAC;EACL;CAED,OAAgB,WAAW;EACvB;GACI,aAAa;GACb,SAAS;GACZ;EACD;GACI,aAAa;GACb,SAAS;GACZ;EACD;GACI,aAAa;GACb,SAAS;GACZ;EACJ;CAED,MAAa,MAAqB;EAC9B,MAAM,EAAE,UAAU,MAAM,KAAK,MAAM,YAAY;EAE/C,MAAM,MAAM,MAAM,OAAO,iBAAiB,GAAG,QAAQ,KAAK;EAC1D,MAAM,OAAO,MAAM,SAAS,eAAe;AAE3C,OAAK,OAAO,KAAK,oBAAoB,KAAK,KAAK;EAC/C,MAAM,iBAAiB,MAAM,MACzB,YACA,kBAAkB,EAAE,QAAQ,MAAM,QAAQ,CAAC,EAC3C;GACI;GACA,OAAO;GACP,aAAa;GACb,QAAQ;GACX,CACJ;AACD,MAAI,eAAe,OAAQ,MAAK,OAAO,MAAM,YAAY,KAAK,UAAU;MACnE,MAAK,OAAO,QAAQ,YAAY,KAAK,0BAA0B;AACpE,OAAK,OAAO,KAAK;AAEjB,OAAK,OAAO,KAAK,kBAAkB,KAAK,KAAK;EAC7C,MAAM,eAAe,MAAM,MAAM,UAAU,gBAAgB,EAAE,QAAQ,MAAM,QAAQ,CAAC,EAAE;GAClF;GACA,OAAO;GACP,aAAa;GACb,QAAQ;GACX,CAAC;AACF,MAAI,aAAa,OAAQ,MAAK,OAAO,MAAM,UAAU,KAAK,UAAU;MAC/D,MAAK,OAAO,QAAQ,UAAU,KAAK,0BAA0B;AAClE,OAAK,OAAO,KAAK;AAEjB,MAAI,CAAC,eAAe,UAAU,CAAC,aAAa,OACxC,MAAK,OAAO,QAAQ,0CAA0C;OAC3D;AACH,QAAK,OAAO,MAAM,sCAAsC;AACxD,QAAK,KAAK,EAAE;;;;;;;ACtExB,MAAa,WAAW,EACpB,MAAM,aACT"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/lint-command.ts","../src/index.ts"],"sourcesContent":["import { Command } from '@jpp-toolkit/core';\nimport { buildEslintArgs, buildPrettierArgs, findProjectRoot } from '@jpp-toolkit/utils';\nimport { Flags } from '@oclif/core';\nimport { execa } from 'execa';\n\nexport class LintCommand extends Command {\n static override summary = 'Run code linting on the project source code.';\n\n static override flags = {\n format: Flags.boolean({\n char: 'f',\n description: 'Automatically fix linting issues.',\n default: false,\n }),\n root: Flags.boolean({\n char: 'R',\n description: 'Lint from the project root directory.',\n default: false,\n }),\n };\n\n static override examples = [\n {\n description: 'Run the lint command.',\n command: '<%= config.bin %> <%= command.id %>',\n },\n {\n description: 'Run the lint command and automatically fix issues.',\n command: '<%= config.bin %> <%= command.id %> --format',\n },\n {\n description: 'Run the lint command from the project root directory.',\n command: '<%= config.bin %> <%= command.id %> --root',\n },\n ];\n\n public async run(): Promise<void> {\n const { flags } = await this.parse(LintCommand);\n\n const cwd = flags.root ? findProjectRoot() : process.cwd();\n const mode = flags.format ? 'formatting' : 'linting';\n\n this.logger.info(`Running Prettier ${mode}...`);\n const prettierResult = await execa(\n 'prettier',\n buildPrettierArgs({ format: flags.format }),\n {\n cwd,\n stdio: 'inherit',\n preferLocal: true,\n reject: false,\n },\n );\n if (prettierResult.failed) this.logger.error(`Prettier ${mode} failed.`);\n else this.logger.success(`Prettier ${mode} completed successfully.`);\n this.logger.log();\n\n this.logger.info(`Running ESLint ${mode}...`);\n const eslintResult = await execa('eslint', buildEslintArgs({ format: flags.format }), {\n cwd,\n stdio: 'inherit',\n preferLocal: true,\n reject: false,\n });\n if (eslintResult.failed) this.logger.error(`ESLint ${mode} failed.`);\n else this.logger.success(`ESLint ${mode} completed successfully.`);\n this.logger.log();\n\n if (!prettierResult.failed && !eslintResult.failed) {\n this.logger.success(`Linting process completed successfully.`);\n } else {\n this.fatalError(`Linting process encountered issues.`);\n }\n }\n}\n","import { LintCommand } from './lint-command';\n\nexport const commands = {\n lint: LintCommand,\n};\n"],"mappings":";;;;;;AAKA,IAAa,cAAb,MAAa,oBAAoB,QAAQ;CACrC,OAAgB,UAAU;CAE1B,OAAgB,QAAQ;EACpB,QAAQ,MAAM,QAAQ;GAClB,MAAM;GACN,aAAa;GACb,SAAS;GACZ,CAAC;EACF,MAAM,MAAM,QAAQ;GAChB,MAAM;GACN,aAAa;GACb,SAAS;GACZ,CAAC;EACL;CAED,OAAgB,WAAW;EACvB;GACI,aAAa;GACb,SAAS;GACZ;EACD;GACI,aAAa;GACb,SAAS;GACZ;EACD;GACI,aAAa;GACb,SAAS;GACZ;EACJ;CAED,MAAa,MAAqB;EAC9B,MAAM,EAAE,UAAU,MAAM,KAAK,MAAM,YAAY;EAE/C,MAAM,MAAM,MAAM,OAAO,iBAAiB,GAAG,QAAQ,KAAK;EAC1D,MAAM,OAAO,MAAM,SAAS,eAAe;AAE3C,OAAK,OAAO,KAAK,oBAAoB,KAAK,KAAK;EAC/C,MAAM,iBAAiB,MAAM,MACzB,YACA,kBAAkB,EAAE,QAAQ,MAAM,QAAQ,CAAC,EAC3C;GACI;GACA,OAAO;GACP,aAAa;GACb,QAAQ;GACX,CACJ;AACD,MAAI,eAAe,OAAQ,MAAK,OAAO,MAAM,YAAY,KAAK,UAAU;MACnE,MAAK,OAAO,QAAQ,YAAY,KAAK,0BAA0B;AACpE,OAAK,OAAO,KAAK;AAEjB,OAAK,OAAO,KAAK,kBAAkB,KAAK,KAAK;EAC7C,MAAM,eAAe,MAAM,MAAM,UAAU,gBAAgB,EAAE,QAAQ,MAAM,QAAQ,CAAC,EAAE;GAClF;GACA,OAAO;GACP,aAAa;GACb,QAAQ;GACX,CAAC;AACF,MAAI,aAAa,OAAQ,MAAK,OAAO,MAAM,UAAU,KAAK,UAAU;MAC/D,MAAK,OAAO,QAAQ,UAAU,KAAK,0BAA0B;AAClE,OAAK,OAAO,KAAK;AAEjB,MAAI,CAAC,eAAe,UAAU,CAAC,aAAa,OACxC,MAAK,OAAO,QAAQ,0CAA0C;MAE9D,MAAK,WAAW,sCAAsC;;;;;;ACrElE,MAAa,WAAW,EACpB,MAAM,aACT"}
@@ -43,5 +43,5 @@
43
43
  "summary": "Run code linting on the project source code."
44
44
  }
45
45
  },
46
- "version": "0.0.15"
46
+ "version": "0.0.16"
47
47
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jpp-toolkit/plugin-lint",
3
- "version": "0.0.15",
3
+ "version": "0.0.16",
4
4
  "description": "Plugin that add the lint command to the jpp cli.",
5
5
  "keywords": [
6
6
  "jpp",
@@ -35,7 +35,7 @@
35
35
  "dependencies": {
36
36
  "@oclif/core": "4.8.0",
37
37
  "execa": "9.6.1",
38
- "@jpp-toolkit/core": "0.0.14",
38
+ "@jpp-toolkit/core": "0.0.15",
39
39
  "@jpp-toolkit/utils": "0.0.14"
40
40
  },
41
41
  "devDependencies": {
@@ -69,8 +69,7 @@ export class LintCommand extends Command {
69
69
  if (!prettierResult.failed && !eslintResult.failed) {
70
70
  this.logger.success(`Linting process completed successfully.`);
71
71
  } else {
72
- this.logger.error(`Linting process encountered issues.`);
73
- this.exit(1);
72
+ this.fatalError(`Linting process encountered issues.`);
74
73
  }
75
74
  }
76
75
  }