# @knime/eslint-config

> ESLint/Stylelint configs designed for typical KNIME frontend projects using JavaScript/TypeScript as well as Vue, Nuxt and Vitest.

Latest version **9.9.1** (published 2026-09-04) · GPL 3 and Additional Permissions according to Sec. 7 (SEE the file LICENSE) license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @knime/eslint-config
pnpm add @knime/eslint-config
yarn add @knime/eslint-config
bun add @knime/eslint-config
```

Provides the command `knime-eslint-config-prepare-commit-msg`.

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 9.9.1 |
| Published | 2026-09-04 |
| First published | 2022-08-30 |
| Weekly downloads | 0 |
| License | GPL 3 and Additional Permissions according to Sec. 7 (SEE the file LICENSE) |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=22 <25 |
| Dependencies | 24 |
| Unpacked size | 87.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | KNIME AG, Zurich, Switzerland |
| Maintainers | knime |

## Links

- npm: https://www.npmjs.com/package/@knime/eslint-config
- Repository: https://github.com/knime/webapps-common
- npm.io page: https://npm.io/package/@knime/eslint-config

## Dependencies (24)

- [globals](https://npm.io/package/globals.md) ^16.3.0
- [@eslint/js](https://npm.io/package/@eslint/js.md) ^9.39.4
- [postcss-html](https://npm.io/package/postcss-html.md) ^1.8.1
- [postcss-import](https://npm.io/package/postcss-import.md) ^16.1.1
- [eslint-plugin-n](https://npm.io/package/eslint-plugin-n.md) ^17.17.0
- [stylelint-order](https://npm.io/package/stylelint-order.md) ^8.1.1
- [eslint-plugin-vue](https://npm.io/package/eslint-plugin-vue.md) ^10.9.1
- [vue-eslint-parser](https://npm.io/package/vue-eslint-parser.md) ^10.4.0
- [@nuxt/eslint-config](https://npm.io/package/@nuxt/eslint-config.md) ^1.15.2
- [jsonc-eslint-parser](https://npm.io/package/jsonc-eslint-parser.md) ^2.4.0
- [eslint-plugin-depend](https://npm.io/package/eslint-plugin-depend.md) ^1.5.0
- [@vitest/eslint-plugin](https://npm.io/package/@vitest/eslint-plugin.md) ^1.6.16
- [eslint-config-prettier](https://npm.io/package/eslint-config-prettier.md) ^10.1.8
- [eslint-plugin-import-x](https://npm.io/package/eslint-plugin-import-x.md) ^4.16.2
- [@typescript-eslint/utils](https://npm.io/package/@typescript-eslint/utils.md) 8.59.2
- [eslint-flat-config-utils](https://npm.io/package/eslint-flat-config-utils.md) ^2.0.1
- [@typescript-eslint/parser](https://npm.io/package/@typescript-eslint/parser.md) 8.59.2
- [stylelint-config-standard](https://npm.io/package/stylelint-config-standard.md) ^40.0.0
- [eslint-plugin-unused-imports](https://npm.io/package/eslint-plugin-unused-imports.md) ^4.4.1
- [@vue/eslint-config-typescript](https://npm.io/package/@vue/eslint-config-typescript.md) ^14.7.0
- [stylelint-config-recess-order](https://npm.io/package/stylelint-config-recess-order.md) ^7.7.0
- [stylelint-config-standard-vue](https://npm.io/package/stylelint-config-standard-vue.md) ^1.0.0
- [@typescript-eslint/eslint-plugin](https://npm.io/package/@typescript-eslint/eslint-plugin.md) 8.59.2
- [eslint-import-resolver-custom-alias](https://npm.io/package/eslint-import-resolver-custom-alias.md) ^1.3.2

## Recent versions

- 9.9.1 (latest) — 2026-09-04
- 9.9.0 — 2026-07-01
- 9.8.0 — 2026-06-17
- 9.7.1 — 2026-05-11
- 9.7.0 — 2026-05-04
- 9.6.0 — 2026-04-09
- 9.5.5 — 2026-03-26
- 9.5.4 — 2026-03-17
- 9.5.3 — 2026-01-26
- 9.5.2 — 2025-12-04
- 9.5.1 — 2025-12-03
- 9.5.0 — 2025-11-20
- 9.4.0 — 2025-10-31
- 9.3.3 — 2025-10-27
- 9.3.2 — 2025-10-22
- … 50 more at https://npm.io/package/@knime/eslint-config/versions

## README

# ![Image](https://www.knime.com/sites/default/files/knime_logo_github_40x40_4layers.png) @knime/eslint-config

This repository contains an [ESLint] ruleset for typical KNIME frontend projects. Rules cover simple
JavaScript/TypeScript setups as well as [Vue]/[Nuxt] projects and common test scenarios with [Vitest].

Also it contains configs for [Stylelint], [lintstaged] and a Git hook to format commit messages.

Code formatting is supposed to be handled via [Prettier].

## Development

### Prerequisites

- Install [Node.js][node], see version in [package.json](package.json).

Newer versions may also work, but have not been tested.

## Installation

To install the `@knime/eslint-config` package, you can use npm:

```sh
npm install @knime/eslint-config -D
```

### Linting

The different ESLint profiles contained herein can also be linted by running

```sh
npm run lint
```

## Using the ESLint profiles in your project

Projects need to specify the following `devDependencies` in their `package.json` files, but none of the required additional plugins:

- [ESlint]
- [Stylelint]
- [Prettier]

### Basic config for JS projects

The following code block should give an understanding of a commonly used setup
in your `eslint.config.js` file:

```js
import knimeVue3Config from "@knime/eslint-config/vue3.js"

export default = [
  ...knimeVue3Config,
  {
    globals: {
      consola: true,
    }
  },
  // [...]
];
```

### Config for projects that use TypeScript

```ts
import knimeVue3TSConfig from "@knime/eslint-config/vue3-typescript.js";

export default [
  ...knimeVue3TSConfig(),
  {
    globals: {
      consola: true,
    },
  },
  // [...]
];
```

Notice that the default export is a function instead of a configuration object. This function takes an _optional_ argument of a path to a tsconfig. Supplying a tsconfig will give you a config that extends the base TS config with some typed rules. Configs that make use of this are:

- `typescript.js`
- `vue3-typescript.js`
- `nuxt3.js`

If you want to make use of typed linting it might make sense to create a separate `tsconfig.eslint.json` which only includes files that should get linted and be as small and focused as possible.

### Linting in Nuxt projects

Nuxt offers an Eslint module to build project aware configs. If you want to use Eslint in a Nuxt project add the Eslint module to Nuxt. By default, this module installs the JS, TS and Vue plugins with their recommended rules. This is already covered by the config exported in `@knime/eslint-config/nuxt3.js` so make sure to have this in the nuxt config:

```js
defineNuxtConfig({
  modules: ["@nuxt/eslint"],
  eslint: {
    config: {
      standalone: false,
    },
  },
});
```

The Eslint config file then looks something like this:

```js
import withNuxt from "./.nuxt/eslint.config.mjs";
import knimeNuxtConfig from "@knime/eslint-config/nuxt3.js";

export default withNuxt([
  ...knimeNuxtConfig(),
  // your other configs here
]);
```

## Using Stylelint in your project

The following code block should give an understanding of a commonly used setup in your `.stylelintrc` file:

```js
module.exports = {
  extends: ["@knime/eslint-config/stylelint/vue"],
  // Point this to the file(s) that define global custom properties, animations and custom
  // media (or remove if the project doesn't have any). Stylelint's built-in
  // `no-unknown-custom-properties`, `no-unknown-animations` and `no-unknown-custom-media`
  // rules use these to avoid false positives.
  // The `postcss-import` loader resolves `@import`ed partials, so you can point at a single
  // entrypoint. Drop the loader (just `referenceFiles: ["src/assets/index.css"]`) if your
  // entrypoint has no `@import`s.
  // See https://stylelint.io/user-guide/configure#referencefiles
  referenceFiles: [{ files: "src/assets/index.css", loader: "postcss-import" }],
};
```

There might be cases where CSS properties are shared between multiple nested Vue components, which Stylelint doesn't know. Do set default values for those to avoid linting errors, e.g. `height: var(--toolbar-height, 0);`.

See [stylelint](stylelint) folder for available configs.

## Using Git hooks in your project

The package supplies the tools to running a couple of commit hooks:

### Linting and formatting staged changes

Include the following in a `pre-commit` hook to lint and format the changes in your stage zone (via [lintstaged]).

```bash
#!/usr/bin/env bash
pnpm dlx lint-staged
```

Additionaly, use the [lint-staged.config.mjs](lint-staged.config.mjs) file to configure lint-staged, i.e. create a `lint-staged.config.mjs` file in the root folder containing

```js
import config from "@knime/eslint-config/lint-staged.config.mjs";
export default config;
```

### Format commit message

Use a `prepare-commit-msg` hook to format your commit message to conform with the required format by KNIME:

```bash
#!/usr/bin/env bash
npm exec knime-eslint-config-prepare-commit-msg "$@"
```

In case the npm project isn't in the root folder, please do:

```bash
#!/usr/bin/env bash
<path-to-npm-project>/node_modules/.bin/knime-eslint-config-prepare-commit-msg "$@"
```

Refer to [scripts/README.md](scripts/README.md) for more information.

[node]: https://knime-com.atlassian.net/wiki/spaces/SPECS/pages/905281540/Node.js+Installation
[ESLint]: https://eslint.org/
[Stylelint]: https://stylelint.io/
[Prettier]: https://prettier.io/
[Vue]: https://vuejs.org/
[Nuxt]: https://nuxtjs.org/
[Vitest]: https://vitest.dev/
[lintstaged]: https://github.com/okonet/lint-staged

---
_Source: https://npm.io/package/@knime/eslint-config · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
