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

eslint-config-epsvue

v1.2.3

Published

A reusable and shareable `eslint` configuration for Vue project

Downloads

767

Readme

eslint-config-epsvue

js-standard-style

NPM Unpacked Size NPM Version NPM Downloads NPM Downloads GA CI

These are my settings for ESLint, Prettier and Stylelint that you can use for Vuejs app

You might like them - or you might not. Don't worry you can always change them.

What do you need to know before using this

This version 1.1.0 use eslint version >= 9.0.0, this support only the nodejs versions above 18.18.0 same as stylelint 16 witch support node 18.12.0.

[!WARNING]
Make sure you upgrade to at least Node.js v18.18.0 when using ESLint v9.0.0. One important thing to double check is the Node.js version supported by your editor when using ESLint via editor integrations. If you are unable to upgrade, we recommend continuing to use ESLint v8.56.0 until you are able to upgrade Node.js. You can read it on the eslint's official documentation

[!NOTE] The current version doesn't support the legacy .eslintrc* configuration format. If ?you want to use this format, feel free to install this version v1.0.4

And you need to note that:

[!NOTE]
If you want to know more about the new configurations, you can see the Key Differences between Configuration Formats

What it does

  • Lints JavaScript and TypeScript based on the latest standards
  • Fixes issues and formatting errors with Prettier
  • Lints + Fixes inside of html script tags
  • You can see all the rules here. You are very welcome to overwrite any of these settings, or just fork the entire thing to create your own.

Project setup

It's recommended you install this once per every project. ESLint used to have global configs, but no longer.

  1. Installation

      npm install -D eslint-config-epsvue
  2. Extend the eslint configuration

    create a file called eslint.config.mjs file in the root of your project. after copy this in the file:

    import pluginEpsVue from "eslint-plugin-epsvue";
    
    export default [...pluginEpsVue];
  3. Extend the stylelint configuration by adding this in the package.json

    "stylelint": {
        "extends": ["eslint-config-epsvue/stylelint"]
      }

    You can also extends it in your own .styelintrc.json file

    {
      "extends": ["eslint-config-epsvue/stylelint"]
    }
  4. You can add two scripts to your package.json to lint, lint fix, format and style css:

     "scripts": {
       "lint": "eslint .", // Detect errors
       "lint:fix": "eslint src/ --fix", //fix all resolvable eslint problems found starting from the base directory
       "format": "prettier src/ -w", // format code starting from the base directory
       "stylelint": "stylelint --aei '**/*.{css,vue,scss}'",
     },

Settings

If you'd like to overwrite eslint or prettier settings, you can add the rules in your .eslintrc file. The ESLint rules go directly under "rules".

import pluginEpsVue from "eslint-plugin-epsvue";

export default [
  ...pluginEpsVue,
  {
    rules: {
      "no-console": 2,
    },
  },
];

Prettier Rules

There are only 2 prettier rules included in my config - singleQuote: true and endOfLine: 'auto'.

If you want custom prettier options, it's recommended to create a .prettierrc file in your root directory like so:

{
  "singleQuote": true,
  "endOfLine": "auto",
  "tabWidth": 4
}

You can also put this in your EsLint config as a rule like so:

import pluginEpsVue from "eslint-plugin-epsvue";

export default [
  ...pluginEpsVue,
  {
    rules: {
      //... any eslint rules here
      "no-console": 2,
      "prettier/prettier": [
        "error",
        {
          singleQuote: true,
          endOfLine: "auto",
          tabWidth: 4,
        },
      ],
    },
  },
];

With VS Code

You should read this entire thing. Serious!

Once you have done one, or both, of the above installs. You probably want your editor to lint and fix for you. Here are the instructions for VS Code:

  • install eslint abd prettier extensions

  • If you use vetur, you need to do this to avoid some eslint issues Now we need to setup some VS Code settings via Code/FilePreferencesSettings. It's easier to enter these settings while editing the settings.json file, so click the Open (Open Settings) icon in the top right corner: Now we need to setup some VS Code settings via Code/FilePreferencesSettings. It's easier to enter these settings while editing the settings.json file, so click the Open (Open Settings) icon in the top right corner:

    add this :

     "vetur.validation.template": false,
     "vetur.validation.script": false,
     "vetur.validation.style": false,

With WSL

It should work as above.

With JetBrains Products (IntelliJ IDEA, WebStorm, RubyMine, PyCharm, PhpStorm, etc)

If you have previously configured ESLint to run via a File Watcher, turn that off.

If you choose Local / Per Project Install Above

  1. Open ESLint configuration by going to File > Settings (Edit > Preferences on Mac) > Languages & Frameworks > Code Quality Tools > ESLint (optionally just search settings for "eslint")
  2. Select Automatic ESLint Configuration
  3. Check Run eslint --fix on save

If you choose Global Install

The following steps are for a typical Node / ESLint global installtion. If you have a customized setup, refer to JetBrains docs for more ESLint Configuration Options.

  1. Open ESLint configuration by going to File > Settings (Edit > Preferences on Mac) > Languages & Frameworks > Code Quality Tools > ESLint (optionally just search settings for "eslint")
  2. Select Manual ESLint configuration
  3. Choose your Node interpreter from the detected installations
  4. Select the global ESLint package from the dropdown
  5. Leave Configuration File as Automatic Search
  6. Check Run eslint --fix on save

Ensure the Prettier plugin is disabled if installed

  1. Open Prettier configuration by going to File > Settings (Edit > Preferences on Mac) > Languages & Frameworks > Code Quality Tools > Prettier (optionally just search settings for "prettier")
  2. Uncheck both On code reformat and On save
  3. Optional BUT IMPORTANT: If you have the Prettier extension enabled for other languages like CSS and HTML, turn it off for JS since we are doing it through Eslint already.
    1. Make sure the Run for files glob does not include js,ts,jsx,tsx.
    2. An example glob for styles, config, and markdown. {**/*,*}.{yml,css,sass,md}

There is also a section on the documentation about 💻Editor integrations

Resources

For any reports

For any report, problems encountered, please report on this discussion feedbacks.