@spacetabs/eslint-config-spacetab-io

0.0.12 • Public • Published

Eslint config by spacetab.io

Programs must be written for people to read, and only incidentally for machines to execute.

Harold Abelson

Content:

Eslint config integration

First, what you need is to install npm package.

npm install --save-dev @spacetabs/eslint-config-spacetab-io

Next, install all peer dependencies. The easiest way is to add this lines to your devDependensies

{
  "eslint": "^6.6.0",
  "@typescript-eslint/parser": "^2.9.0",
  "eslint-plugin-import": "^2.18.2",
  "eslint-plugin-simple-import-sort": "^4.0.0",
  "eslint-plugin-vue": "^6.0.0",
  "@typescript-eslint/eslint-plugin": "^2.6.1",
  "@vue/eslint-config-typescript": "^4.0.0",
  "vue-eslint-parser": "^7.0.0",
  "typescript": "^3.6.4",
  "babel-eslint": "^10.0.3"
}

After previous operations add this to your eslint configuration.

{
  "extends": [
    "@spacetabs/eslint-config-spacetab-io"
  ],
  "parserOptions": {
    "project": "./tsconfig.json",
    "sourceType": "module",
    "extraFileExtensions": [".vue"]
  }
}

PROFIT! Now you can use our eslint configuration in your awesome projects!

Minimal eslint configuration example

{
  "root": true,
  "parserOptions": {
    "project": "./tsconfig.json",
    "sourceType": "module",
    "extraFileExtensions": [".vue"]
  },
  "extends": [
    "@spacetabs/eslint-config-spacetab-io"
  ]
}

Go top


Eslint config options

Here we have 3 configs:

base

  • vue linting
  • typescript
  • javascript linting

Usage:

{
  "extends": ["@spacetabs/eslint-config-spacetab-io"]
}

Also, If you have typescript and javascript .vue files. You can change the extension from .vue to .js.vue. Linter will check code in these components like a javascript.

vue javascript only

Combined vue-html and javascript rules

Usage:

{
  "extends": ["@spacetabs/eslint-config-spacetab-io/vue-javascript"]
}

only vue html

Usage:

{
  "extends": ["@spacetabs/eslint-config-spacetab-io/vue-html"]
}

only typescript

Usage:

{
  "extends": ["@spacetabs/eslint-config-spacetab-io/typescript"]
}

only javascript

Usage:

{
  "extends": ["@spacetabs/eslint-config-spacetab-io/javascript"]
}

Go top

Package Sidebar

Install

npm i @spacetabs/eslint-config-spacetab-io

Weekly Downloads

7

Version

0.0.12

License

MIT

Unpacked Size

32.9 kB

Total Files

14

Last publish

Collaborators

  • mgorunuch
  • mikrowelt
  • nbrylevv
  • roquie