@marcrock22/veslint 0.36.0 → 0.37.0
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 +3 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -61,8 +61,8 @@ veslint <file.ts | directory>... [--config <file>] [--rule <rule> [--no-config-l
|
|
|
61
61
|
|---|---|
|
|
62
62
|
| `<directory>` | Lints the `.ts`, `.mts`, `.cts`, `.tsx`, `.vue` and `.svelte` files under it, as `eslint .` does: `node_modules`, `.git` and what the configuration ignores are left out. |
|
|
63
63
|
| `<file.ts>` | Lints that file. JavaScript files are not linted: veslint only reads TypeScript. |
|
|
64
|
-
| `<file.vue>` | Lints the TypeScript script of a Vue file (`<script lang="ts">` and `<script setup lang="ts">`) and, with the `vue/*` rules, its template, as ESLint does with vue-eslint-parser and typescript-eslint's parser: the rules see the script with the positions of the file, and the types are those typescript-eslint gives with `extraFileExtensions: ['.vue']`. A Vue file whose script is JavaScript is skipped with a warning. |
|
|
65
|
-
| `<file.svelte>` | Lints the TypeScript script of a Svelte file (`<script lang="ts">`, `<script module lang="ts">`) and the `.svelte.ts` modules, as ESLint does with svelte-eslint-parser and typescript-eslint's parser: runes, stores (`$store`), `$:` statements, props and generics as svelte-eslint-parser models them, and the types typescript-eslint gives with `extraFileExtensions: ['.svelte']`. A Svelte file whose script is JavaScript is not linted (with a warning). With the `svelte/*` rules (all 86 of eslint-plugin-svelte's), its template and `<style>` too. `svelte.config.js` is read as svelte-eslint-parser reads it, statically (without running it: its `compilerOptions.runes` and `kit.files` when they are literals, `const`s or object literals), unless `parserOptions.svelteConfig` is given; the parse and the rules follow its `runes` after `parserOptions.svelteFeatures.runes` and `<svelte:options runes>`, as svelte-eslint-parser does. A `runes` function in the `parserOptions.svelteConfig` of an `eslint.config.*` is called for each Svelte file with its path, as svelte-eslint-parser and eslint-plugin-svelte call it (the resolved configuration keeps what it gave for each file); in `svelte.config.js` it is not, as svelte-eslint-parser does not run that file. |
|
|
64
|
+
| `<file.vue>` | Lints the TypeScript script of a Vue file (`<script lang="ts">` and `<script setup lang="ts">`) and, with the `vue/*` rules, its template, as ESLint does with vue-eslint-parser and typescript-eslint's parser: the rules see the script with the positions of the file, and the types are those typescript-eslint gives with `extraFileExtensions: ['.vue']`. JSX is read as typescript-estree reads it there: only with `parserOptions.ecmaFeatures.jsx`, whatever the `lang` (`lang="tsx"` alone is TypeScript without JSX), and in the template's expressions but not in the script when the parser has a program (`project`, `projectService`). A script TypeScript cannot parse is ESLint's fatal `Parsing error`, at the place vue-eslint-parser gives. A Vue file whose script is JavaScript is skipped with a warning. |
|
|
65
|
+
| `<file.svelte>` | Lints the TypeScript script of a Svelte file (`<script lang="ts">`, `<script module lang="ts">`) and the `.svelte.ts` modules, as ESLint does with svelte-eslint-parser and typescript-eslint's parser: runes, stores (`$store`), `$:` statements, props and generics as svelte-eslint-parser models them, and the types typescript-eslint gives with `extraFileExtensions: ['.svelte']`. JSX is read as svelte-eslint-parser and typescript-estree read it: only with `parserOptions.ecmaFeatures.jsx`, whatever the `lang` (`lang="tsx"` is TypeScript), in the script and the template's expressions, and the parse of its virtual code is TypeScript when the parser has a program (`project`, `projectService`); the template's expressions are the Svelte compiler's, which never takes JSX. A Svelte file whose script is JavaScript is not linted (with a warning). With the `svelte/*` rules (all 86 of eslint-plugin-svelte's), its template and `<style>` too. `svelte.config.js` is read as svelte-eslint-parser reads it, statically (without running it: its `compilerOptions.runes` and `kit.files` when they are literals, `const`s or object literals), unless `parserOptions.svelteConfig` is given; the parse and the rules follow its `runes` after `parserOptions.svelteFeatures.runes` and `<svelte:options runes>`, as svelte-eslint-parser does. A `runes` function in the `parserOptions.svelteConfig` of an `eslint.config.*` is called for each Svelte file with its path, as svelte-eslint-parser and eslint-plugin-svelte call it (the resolved configuration keeps what it gave for each file); in `svelte.config.js` it is not, as svelte-eslint-parser does not run that file. |
|
|
66
66
|
| `--config <file>` | The configuration (see below). Without it and without `--rule`, a directory is linted with the closest `eslint.config.*`. |
|
|
67
67
|
| `--rule <rule>` | Lints with one rule, named as in ESLint: `no-var`, `@typescript-eslint/await-thenable`. Its options, and the files it lints, are the ones the closest `eslint.config.*` gives it (on with its default options when the configuration has it off); without a configuration, its default options. Directive comments for other rules are left alone: they are never reported as unused, and `--fix` keeps them. |
|
|
68
68
|
| `--no-config-lookup` | With `--rule`: the rule's default options, without looking for an `eslint.config.*`. |
|
|
@@ -200,6 +200,7 @@ The extension shows the problems of the TypeScript files you open and type, unde
|
|
|
200
200
|
- **Linux x64 and Windows x64.** Other platforms need a build from source, which is not tested there.
|
|
201
201
|
- **An `eslint.config.*` needs `bun`** to be read; the resolved configuration (`--print-config`) does not. A cached resolution is reused while the files and modules the configuration read and the environment variables it read stay the same: a configuration that depends on something else (the date, a file it lists but does not read, a new `tsconfig.json` a glob of `parserOptions.project` matches) needs `VESLINT_CONFIG_CACHE=0`.
|
|
202
202
|
- **The newest TypeScript syntax** may not be read yet: veslint warns when a file has syntax it does not understand, and some problems of that file may be missing.
|
|
203
|
+
- **Parsing errors:** a file TypeScript's parser rejects is ESLint's fatal `Parsing error`, with TypeScript's first syntactic diagnostic as tsgo sorts them (by position): when the parser of TypeScript 6, which typescript-estree uses, reported two errors at the same position, the one ESLint prints may be the other (`const b = <` at the end of a file: `Type expected.` in ESLint, `Expression expected.` in veslint). Syntax only veslint's grammar does not read (see above) is linted on with a warning.
|
|
203
204
|
- **Plugins:** only the rules listed above. Rules of other plugins are skipped with a warning.
|
|
204
205
|
|
|
205
206
|
## Building from source
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marcrock22/veslint",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.37.0",
|
|
4
4
|
"description": "A TypeScript linter in V that talks to TypeScript 7 (tsc --api) directly: the rules of ESLint, typescript-eslint, unicorn, @stylistic, perfectionist and seyfert, with the same results.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"veslint": "bin/veslint.js"
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
"bin"
|
|
10
10
|
],
|
|
11
11
|
"optionalDependencies": {
|
|
12
|
-
"@marcrock22/veslint-linux-x64": "0.
|
|
13
|
-
"@marcrock22/veslint-win32-x64": "0.
|
|
12
|
+
"@marcrock22/veslint-linux-x64": "0.37.0",
|
|
13
|
+
"@marcrock22/veslint-win32-x64": "0.37.0"
|
|
14
14
|
},
|
|
15
15
|
"keywords": [
|
|
16
16
|
"typescript",
|