Skip to content

Commit

Permalink
Version 1.0.0 with Vue 3 support
Browse files Browse the repository at this point in the history
  • Loading branch information
nbrylevv committed Jul 14, 2021
1 parent 8e8e9f2 commit 62ed066
Show file tree
Hide file tree
Showing 12 changed files with 3,732 additions and 533 deletions.
103 changes: 4 additions & 99 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,100 +1,5 @@
# Linting configs by spacetab.io
# Linter configurations by [SpaceTab.io](https://github.com/spacetab-io)

> Any fool can write code that a computer can understand. Good programmers write code that humans can understand.
> ###### Martin Fowler

#### Configs:
- [Stylelint](./packages/stylelint-config-spacetab-io)
- [Eslint](./packages/eslint-config-spacetab-io)
---

#### Content:
- [⚙ Eslint config integration](#eslint-config-integration)
- [⚙ Stylelint config integration](#stylelint-config-integration)

## Eslint config integration

First, what you need is to install npm package.
```bash
npm install --save-dev @spacetab-io/eslint-config-spacetab-io
```

Next, install all peer dependencies. The easiest way is to add this lines to your `devDependensies`
```json
{
"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.
```json
{
"extends": [
"@spacetab-io/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
```json
{
"root": true,
"parserOptions": {
"project": "./tsconfig.json",
"sourceType": "module",
"extraFileExtensions": [".vue"]
},
"extends": [
"@spacetab-io/eslint-config-spacetab-io"
]
}
```

[⬆ Go top](#linting-configs-by-spacetabio)

------

## Stylelint config integration

First, what you need is to install npm package.
```bash
npm install --save-dev @spacetab-io/eslint-config-spacetab-io
```

Next, install all peer dependencies. The easiest way is to add this lines to your `devDependensies`
```json
{
"stylelint": "^10.1.0",
"stylelint-config-recess-order": "^2.0.3",
"stylelint-config-standard": "^18.3.0",
"stylelint-declaration-use-variable": "^1.7.0",
"stylelint-scss": "^3.9.3"
}
```

After previous operations add this to your eslint configuration.
```json
{
"extends": ["@spacetab-io/stylelint-config-spacetab-io"]
}
```

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

[⬆ Go top](#linting-configs-by-spacetabio)
Linter configurations we have:
- [stylelint configuration](./packages/stylelint-config-spacetab-io)
- [eslint configuration](./packages/eslint-config-spacetab-io)
2 changes: 1 addition & 1 deletion packages/eslint-config-spacetab-io/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 SpaceTab
Copyright (c) 2019-2021 SpaceTab

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
29 changes: 19 additions & 10 deletions packages/eslint-config-spacetab-io/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Eslint config by spacetab.io

**Now supports Vue 3!**

For Vue 2 use [0.1.0 version](https://github.com/spacetab-io/linters-front/tree/0.1.0/packages/eslint-config-spacetab-io) of this library.

> Programs must be written for people to read, and only incidentally for machines to execute.
> ###### Harold Abelson
Expand All @@ -18,19 +22,24 @@ npm install --save-dev @spacetab-io/eslint-config-spacetab-io
Next, install all peer dependencies. The easiest way is to add this lines to your `devDependensies`
```json
{
"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"
"eslint": "^6.7.2",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-simple-import-sort": "^7.0.0",
"eslint-import-resolver-webpack": "^0.13.1",
"eslint-plugin-vue": "^7.0.0",
"@typescript-eslint/eslint-plugin": "^4.18.0",
"@typescript-eslint/parser": "^4.18.0",
"@vue/eslint-config-typescript": "^7.0.0",
"vue-eslint-parser": "^7.8.0",
"typescript": "~4.1.5",
"babel-eslint": "^10.1.0"
}
```

```bash
npm install --save-dev eslint@^6.7.2 eslint-plugin-import@^2.20.2 eslint-plugin-simple-import-sort@^7.0.0 eslint-import-resolver-webpack@^0.13.1 eslint-plugin-vue@^7.0.0 @typescript-eslint/eslint-plugin@^4.18.0 @typescript-eslint/parser@^4.18.0 @vue/eslint-config-typescript@^7.0.0 vue-eslint-parser@~4.1.5 babel-eslint@^10.1.0
```

After previous operations add this to your eslint configuration.
```json
{
Expand Down
6 changes: 3 additions & 3 deletions packages/eslint-config-spacetab-io/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module.exports = {
// .vue (all)
{
files: ['*.vue'],
extends: ['plugin:vue/base'],
extends: ['plugin:vue/vue3-essential'],
plugins: [
'vue',
],
Expand All @@ -45,7 +45,7 @@ module.exports = {
parser: '@typescript-eslint/parser',
},
files: ['*.js.vue'],
extends: ['plugin:vue/base'],
extends: ['plugin:vue/vue3-essential'],
rules: {
...require('./rules/vue-html.js'),
...require('./rules/javascript.js'),
Expand All @@ -65,7 +65,7 @@ module.exports = {
'import',
'simple-import-sort',
],
extends: ['plugin:vue/base'],
extends: ['plugin:vue/vue3-essential'],
rules: {
...require('./rules/javascript.js'),
...require('./rules/typescript-reset.js'),
Expand Down
Loading

0 comments on commit 62ed066

Please sign in to comment.