@forsakringskassan/eslint-config-vue

Försäkringskassans eslint shareable vue config
286,740
Install
npm install @forsakringskassan/eslint-config-vue
Latest Version:15.12.1
Vue:3
Older releases:2
License:MIT
Last Updated:Oct 20, 2026
Links: GitHub  ·  npm
Maintainer: ext

eslint-config-fk

Försäkringskassan ESLint shareable konfiguration

Installation

npm install --save-dev @forsakringskassan/eslint-config

Innehåll

Detta NPM paket innehåller en grundkonfiguration för ESLint anpassad för FK.

Vissa regler är konfigurerade som varningar och släpps igenom i lokala byggen. Byggjobb som körs från CI/CD släpper inte igenom varningar.

För att använda ska din package.json innehålla två script:

{
    "scripts": {
        "eslint": "eslint --cache .",
        "eslint:fix": "eslint --fix ."
    }
}

Kataloger och filer som ska ignoreras läggs in i .eslintignore eller med excludedFiles i overrides.

Användande

@forsakringskassan/eslint-config inkluderar eslint så din applikation behöver inte själv hålla ett eget beroende mot eslint, om du har ett sen tidigare kan du med fördel ta bort det.

I din eslint.config.mjs:

import defaultConfig from "@forsakringskassan/eslint-config";
import cliConfig from "@forsakringskassan/eslint-config-cli";
import cypressConfig from "@forsakringskassan/eslint-config-cypress";
import jestConfig from "@forsakringskassan/eslint-config-jest";
import svelteConfig from "@forsakringskassan/eslint-config-svelte";
import typescriptConfig from "@forsakringskassan/eslint-config-typescript";
import typeinfoConfig from "@forsakringskassan/eslint-config-typescript-typeinfo";
import vueConfig from "@forsakringskassan/eslint-config-vue";
import pkg from "./package.json" with { type: "json" };

export default [
    {
        name: "Ignored files",
        ignores: [
            "**/coverage/**",
            "**/dist/**",
            "**/node_modules/**",
            "**/public/**",
            "**/temp/**",
            "**/typedoc/**",
        ],
    },

    ...defaultConfig,

    cliConfig(pkg),
    typescriptConfig(),
    typeinfoConfig(import.meta.dirname),
    vueConfig(),
    jestConfig(),
    cypressConfig(),
    svelteConfig(),
];

Konfigurationsfabriker tar ett optional object för att anpassa filer som ska matchas:

export default [
    typescriptConfig({
        files: ["..."],
    }),
];

Behöver man skriva över regler använder man ett nytt block under fabriker:

import { defineConfig } from "@forsakringskassan/eslint-config";

export default [
    defineConfig({
        name: "local",
        rules: {/* ... */},
    }),
];

@forsakringskassan/eslint-config reexports globals, if you need to overwrite global variables for a set of files:

import defaultConfig, { globals } from "@forsakringskassan/eslint-config";

export default [
    ...defaultConfig,

    {
        name: "local/browser",
        files: ["src/browser/**/*.{js,ts}"],
        languageOptions: {
            globals: { ...globals.browser },
        },
    },
];

@forsakringskassan/eslint-config exports some additional specialized configurations:

import {
    appConfig,
    docsConfig,
    examplesConfig,
    sandboxConfig,
} from "@forsakringskassan/eslint-config";
  • appConfig includes overrides for end user applications.
  • docsConfig includes overrides for a documentation site (default in the docs folder).
  • examplesConfig includes overrides for documentation examples.
  • sandboxConfig includes overrides for sandbox applications.

appConfig is to be used with end user application and the others are typically used in a monorepo component library such as forsakringskassan/designsystem.

Github action

To use with Github actions:

steps:
    - uses: actions/checkout@v5
    - name: Use Node.js
      uses: actions/setup-node@v6
    - name: Install dependencies
      run: npm ci
    - name: ESLint
      uses: Forsakringskassan/eslint-config@main

main can also be replaced by a semantic versioned tag such as v13.0.0:

-uses: Forsakringskassan/eslint-config@main
+uses: Forsakringskassan/eslint-config@v13.0.0

This is recommended when using a tool such as Renovate to manage dependencies.

[!IMPORTANT] You need to have @forsakringskassan/eslint-config installed as a dependency in package.json. This ensures you have control over which version of the tool is actually running.

If you are using a tag for version make sure it matches the version in package.json.

Related Packages

@scayle/eslint-config-storefront

SCAYLE Commerce Engine specific eslint configuration

218,314
eslint-config-vue

eslint config for vue.js projects

313,105 320
@cloudflight/eslint-plugin-vue

Cloudflight eslint-plugin & eslint-config for vue

38,060
@html-validate/eslint-config-vue

Eslint sharable config used by the various HTML-validate packages

24,074

Version History

Version Released License
15.12.1 MIT
15.12.0 MIT
15.11.14 MIT
15.11.11 MIT
15.11.10 MIT