npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@dsb-norge/eslint-config-dsb-vue3-ts

v3.0.3

Published

ESLint standard config for Vue.js version 3 projects with Typescript support

Downloads

406

Readme

eslint-config-dsb-vue3-ts

npm version GitHub license

Installation

The default export contains all default ESLint rules for Vue3 TypeScript , including the recommended ruleset for Vue, the opinionated recommended ruleset for TypeScript and the ones listed in the rules section .

Install the package with:

npm install --dev @dsb-norge/eslint-config-dsb-vue3-ts

Usage

Now add the config to youreslint.config.mjs file:

import dsbConfig from '@dsb-norge/eslint-config-dsb-vue3-ts'

export default [
  ...dsbConfig
]

Assumptions

This ESLint configuration comes with some fundamental assumptions:

  • eslint 9 and flat config
  • vue.js 3 and/or node environment
  • browser and/or node environment
  • vite
  • TypeScript

Despite some assumptions, you can easily overwrite, extend and unset rules and any other setting in your custom eslint config.

Migrate from version 2.x to 3.x (eslint 8 to eslint 9)

Package cleanup

  • If installed, remove packages that are no longer needed in local package.json:
npm uninstall -D @rushstack/eslint-patch @stylistic/eslint-plugin @vue/eslint-config-typescript eslint-plugin-vue eslint-plugin-vuejs-accessibility
  • The eslint library must be of version 9 or higher. If you are using eslint 8, you must upgrade to version 9 or higher.
npm install eslint@latest

package.json scripts

  • Update the scripts
 "scripts": {
    ...,
    "lint": "eslint",
    "lint:fix": "eslint --fix"
  }

Configuration

Configuration now lives in eslint.config.mjs instead of .eslintrc.js.

from:

// .eslintrc.js
/* eslint-env node */
require('@rushstack/eslint-patch/modern-module-resolution')

module.exports = {
  root: true,
  extends: [
    '@dsb-norge/dsb-vue3-ts'
  ],
  rules: {
    indent: [ 'error', 2, { SwitchCase: 1 } ]
  },
  parserOptions: {
    ecmaVersion: 'latest'
  }
}

to

// eslint.config.mjs
import dsbConfig from '@dsb-norge/eslint-config-dsb-vue3-ts'

export default [
  ...dsbConfig,
  {
    rules: {
      // your custom overrides here
    }
  }
]

With cypress config

Same as over, but adding cypress for only the cypress files. Note the spread operator since we are wrapping this in a separate object, this is different from what is described in the cypress documentation.

See eslint documentation for more information.

// eslint.config.mjs
import dsbConfig from '@dsb-norge/eslint-config-dsb-vue3-ts'
import pluginCypress from 'eslint-plugin-cypress/flat'


export default [
  ...dsbConfig,
  {
    name: 'Cypress',
    ...pluginCypress.configs.recommended,
    files: [
      '**/__tests__/*.{cy,spec}.{js,ts,jsx,tsx}',
      'cypress/e2e/**/*.{cy,spec}.{js,ts,jsx,tsx}',
      'cypress/support/**/*.{js,ts,jsx,tsx}'
    ],
    rules: {
      // your custom overrides for cypress here
    }
  },
  {
    rules: {
      // your custom overrides here
    }
  }
]