Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ node_modules
dist
report
*.tgz
coverage
coverage
www
loader
.stencil
46 changes: 39 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ module.exports = [
];
```

By default, ESLint will ignore your `node_modules/` directory. Consider adding a `.eslintignore` file at the root of
your project with any output target directories to avoid false positive errors from ESLint.
Exclude
directories created by the Stencil compilation process with an `ignores` entry instead:

```
# place any directories created by the Stencil compilation process here
dist
loader
www
```js
// eslint.config.js
import stencil from "@stencil/eslint-plugin";

export default [{ ignores: ["dist", "loader", "www"] }, stencil.configs.flat.recommended];
```

Lint all your project:
Expand All @@ -60,8 +60,40 @@ Lint all your project:
npm run lint
```

### Configuration (oxlint)

This plugin can also run under [oxlint](https://oxc.rs/docs/guide/usage/linter.html) via its `jsPlugins`
support, instead of ESLint:

```bash
npm i --save-dev oxlint @stencil/eslint-plugin
```

```json
// .oxlintrc.json
{
"jsPlugins": [{ "name": "stencil", "specifier": "@stencil/eslint-plugin" }],
"rules": {
"stencil/async-methods": "error",
"stencil/methods-must-be-public": "error"
}
}
```

TypeScript type information (e.g. type-aware checks in `async-methods`) run in a degraded, type-blind
mode under oxlint, since oxlint doesn't do type resolution.

```sh
npx oxlint .
```

### Configuration (legacy: .eslintrc*)

Only works on ESLint 8, or ESLint 9 with the `ESLINT_USE_FLAT_CONFIG=false` environment variable set -
ESLint no longer reads `.eslintrc.*` files by default, and that escape hatch is removed entirely in
ESLint 10. Use the [flat config](#configuration-new-eslintconfig) above unless you have a specific
reason not to.

`.eslintrc.json` configuration file:

```json
Expand Down
30 changes: 27 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"Jack Woodward <jack@addtoevent.co.uk>",
"Ionic Team <strteam@ionicframework.com>",
"d0whc3r <d0whc3r@gmail.com>",
"Christian Bromann <christian.bromann@outsystems.com>"
"Christian Bromann <christian.bromann@outsystems.com>",
"John Jenkins <johnljenkins@hotmail.com>"
],
"repository": {
"type": "git",
Expand Down Expand Up @@ -49,6 +50,7 @@
"tsutils": "^3.21.0"
},
"devDependencies": {
"@stencil/cli": "^5.0.0 || >=5.0.0-alpha.19 <5.0.0-next.0",
"@types/eslint": "9.6.1",
"@types/eslint-utils": "^3.0.5",
"@types/estree": "^1.0.8",
Expand All @@ -67,14 +69,36 @@
"vitest": "^4.0.5"
},
"peerDependencies": {
"@stencil/core": "^4.0.0 || ^5.0.0 || >=5.0.0-alpha.19 <5.0.0-next.0",
"@typescript-eslint/eslint-plugin": "^7.0.0 || ^8.0.0",
"@typescript-eslint/parser": "^7.0.0 || ^8.0.0",
"eslint": "^8.0.0 || ^9.0.0 || ^10.0.0",
"eslint-plugin-react": "^7.37.4",
"typescript": "^4.9.4 || ^5.0.0"
"oxlint": "^1.73.0",
"typescript": "^4.9.4 || ^5.0.0 || ^6.0.0"
},
"peerDependenciesMeta": {
"@typescript-eslint/eslint-plugin": {
"optional": true
},
"@typescript-eslint/parser": {
"optional": true
},
"eslint": {
"optional": true
},
"eslint-plugin-react": {
"optional": true
},
"oxlint": {
"optional": true
}
},
"engines": {
"node": ">=22.0.0"
},
"packageManager": "pnpm@11.10.0"
"packageManager": "pnpm@11.10.0",
"stencil": {
"wizard": "./dist/wizard.js"
}
}
Loading