GithubHelp home page GithubHelp logo

hugo-t-b / eslint-config Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 187 KB

My ESLint config for JS, TS, and Vue

License: MIT License

TypeScript 100.00%
eslint eslint-config javascript typescript vue

eslint-config's Introduction

My ESLint Config

This is my ESLint configuration for JavaScript, TypeScript, Vitest unit tests, and Vue SFCs.

Installation

As a dev-dependency

npm install --save-dev @hugo-t-b/eslint-config

Globally

npm install --global @hugo-t-b/eslint-config

Usage

Modify the extends property in your .eslintrc:

# .eslintrc.yaml
extends: "@hugo-t-b"
# ...

All rules can be modified or turned off with the rules property in your .eslintrc.

TypeScript

extends: "@hugo-t-b/eslint-config/typescript"
# ...

You will need a tsconfig.json file and to have installed @typescript-eslint/eslint-plugin, @typescript-eslint/parser, and eslint-import-resolver-typescript.

Vitest

extends: "@hugo-t-b/eslint-config/vitest"
# ...

This config builds on the TypeScript one, so you will need to follow the steps needed for that to work.

Vue

You will need to add the JavaScript config before the Vue one in the extends property of your .eslintrc:

extends: 
  - "@hugo-t-b"
  - "@hugo-t-b/eslint-config/vue"
# ...

You will need to have installed eslint-plugin-vue and vue-eslint-parser.

With the TypeScript config

The Vue config works with the TypeScript config automatically. Once you have followed the steps needed for both to work, add the TypeScript config before the Vue one in the extends property of your .eslintrc:

extends:
  - "@hugo-t-b/eslint-config/typescript"
  - "@hugo-t-b/eslint-config/vue"
# ...

Note: you will need a script or <script setup> with the lang set to ts in every SFC. To remove this requirement, set parserOptions.parser to @typescript-eslint/parser in your .eslintrc.

eslint-config's People

Contributors

hugo-t-b avatar

Watchers

 avatar

eslint-config's Issues

Add Vue config

Currently, there is no Vue (3) ESLint configuration in this project.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.