@travetto/eslint 8.0.0-alpha.15 → 8.0.0-alpha.18

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/README.md CHANGED
@@ -16,18 +16,25 @@ yarn add @travetto/eslint
16
16
  [ESLint](https://eslint.org/) is the standard for linting [Typescript](https://typescriptlang.org) and [Javascript](https://developer.mozilla.org/en-US/docs/Web/JavaScript) code. This module provides some standard linting patterns and the ability to create custom rules. Due to the fact that the framework supports both [CommonJS](https://nodejs.org/api/modules.html) and [Ecmascript Module](https://nodejs.org/api/esm.html) formats, a novel solution was required to allow [ESLint](https://eslint.org/) to load [Ecmascript Module](https://nodejs.org/api/esm.html) files.
17
17
 
18
18
  **Note**: The [ESLint](https://eslint.org/) has introduced [a new configuration format](https://eslint.org/blog/2022/08/new-config-system-part-3/) which allows for [Ecmascript Module](https://nodejs.org/api/esm.html) files.
19
-
20
- ## CLI - Register
21
19
  In a new project, the first thing that will need to be done, post installation, is to create the eslint configuration file.
22
20
 
23
- **Terminal: Registering the Configuration**
21
+ ## CLI - eslint:register
22
+
23
+ **Terminal: Help for eslint:register**
24
24
  ```bash
25
- $ trv eslint:register
25
+ $ trv eslint:register --help
26
+
27
+ Usage: eslint:register [options]
28
+
29
+ Generate the workspace ESLint configuration entry file.
26
30
 
27
- Wrote eslint config to <workspace-root>/eslint.config.js
31
+ This bootstraps `eslint.config.js` to load framework-provided rule wiring.
32
+
33
+ Options:
34
+ --help display help for command
28
35
  ```
29
36
 
30
- This is the file the linter will use, and any other tooling (e.g. IDEs).
37
+ When registration completes, this is the file the linter will use, and any other tooling (e.g. IDEs).
31
38
 
32
39
  **Code: Sample configuration**
33
40
  ```javascript
@@ -36,10 +43,8 @@ const { rules } = await import('./.trv/output/node_modules/@travetto/eslint/supp
36
43
  export { rules as default };
37
44
  ```
38
45
 
39
- The output is tied to whether or not you are using the [CommonJS](https://nodejs.org/api/modules.html) or [Ecmascript Module](https://nodejs.org/api/esm.html) format.
40
-
41
- ## CLI - Lint
42
- Once installed, using the linter is as simple as invoking it via the cli:
46
+ ## CLI - eslint
47
+ Once registered, using the linter is as simple as invoking it via the cli:
43
48
 
44
49
  **Terminal: Running the Linter**
45
50
  ```bash
@@ -48,6 +53,25 @@ npx trv eslint
48
53
 
49
54
  Or pointing your IDE to reference the registered configuration file.
50
55
 
56
+ **Terminal: Help for eslint**
57
+ ```bash
58
+ $ trv eslint --help
59
+
60
+ Usage: eslint [options]
61
+
62
+ Run ESLint for the workspace or changed files.
63
+
64
+ Supports incremental mode (`changed`/`since`) and forwards formatting/fix
65
+ options to the underlying eslint invocation.
66
+
67
+ Options:
68
+ -c, --changed Only check changed modules (default: false)
69
+ -f, --format <string> Output format
70
+ -s, --since <string> Since a specific git commit
71
+ --fix Should we attempt to fix?
72
+ --help display help for command
73
+ ```
74
+
51
75
  ## Custom Rules
52
76
  It can be seen in the sample configuration, that the configuration is looking for files with the pattern of `support/eslint/.*`
53
77
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/eslint",
3
- "version": "8.0.0-alpha.15",
3
+ "version": "8.0.0-alpha.18",
4
4
  "type": "module",
5
5
  "description": "ES Linting Rules",
6
6
  "keywords": [
@@ -26,16 +26,16 @@
26
26
  "dependencies": {
27
27
  "@eslint/js": "^10.0.1",
28
28
  "@stylistic/eslint-plugin": "^5.10.0",
29
- "@travetto/runtime": "^8.0.0-alpha.14",
29
+ "@travetto/runtime": "^8.0.0-alpha.17",
30
30
  "@types/eslint": "^9.6.1",
31
- "@typescript-eslint/eslint-plugin": "^8.58.2",
32
- "@typescript-eslint/parser": "^8.58.2",
33
- "@typescript-eslint/typescript-estree": "^8.58.2",
34
- "eslint": "^10.2.0",
31
+ "@typescript-eslint/eslint-plugin": "^8.60.1",
32
+ "@typescript-eslint/parser": "^8.60.1",
33
+ "@typescript-eslint/typescript-estree": "^8.60.1",
34
+ "eslint": "^10.4.1",
35
35
  "eslint-plugin-unused-imports": "^4.4.1"
36
36
  },
37
37
  "peerDependencies": {
38
- "@travetto/cli": "^8.0.0-alpha.20"
38
+ "@travetto/cli": "^8.0.0-alpha.23"
39
39
  },
40
40
  "peerDependenciesMeta": {
41
41
  "@travetto/cli": {
@@ -4,7 +4,10 @@ import { Env, ExecUtil, Runtime } from '@travetto/runtime';
4
4
  import { type CliCommandShape, CliCommand, CliModuleUtil } from '@travetto/cli';
5
5
 
6
6
  /**
7
- * Command line support for eslint
7
+ * Run ESLint for the workspace or changed files.
8
+ *
9
+ * Supports incremental mode (`changed`/`since`) and forwards formatting/fix
10
+ * options to the underlying eslint invocation.
8
11
  */
9
12
  @CliCommand()
10
13
  export class ESLintCommand implements CliCommandShape {
@@ -4,7 +4,9 @@ import { type CliCommandShape, CliCommand } from '@travetto/cli';
4
4
  import { Runtime, RuntimeIndex } from '@travetto/runtime';
5
5
 
6
6
  /**
7
- * Writes the eslint configuration file
7
+ * Generate the workspace ESLint configuration entry file.
8
+ *
9
+ * This bootstraps `eslint.config.js` to load framework-provided rule wiring.
8
10
  */
9
11
  @CliCommand({})
10
12
  export class ESLintConfigureCommand implements CliCommandShape {