Skip to content

Commit

Permalink
Merge pull request #1 from spacetabs/readme-changes
Browse files Browse the repository at this point in the history
Base, eslint, stylelint readme files.
  • Loading branch information
mgorunuch authored Nov 27, 2019
2 parents f92d35c + 871d7fc commit 0b0e4ba
Show file tree
Hide file tree
Showing 3 changed files with 138 additions and 9 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ After previous operations add this to your eslint configuration.
}
```

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

------

Expand All @@ -88,13 +88,13 @@ Next, install all peer dependencies. The easiest way is to add this lines to you
}
```

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

After previous operations add this to your eslint configuration.
**PROFIT!** Now you can use our stylelint configuration in your awesome projects!

[⬆ Go top](#content)
[⬆ Go top](#linting-configs-by-spacetabio)
110 changes: 104 additions & 6 deletions packages/eslint-config-spacetab-io/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,108 @@
> Programs must be written for people to read, and only incidentally for machines to execute.
> ###### Harold Abelson
Here we have 3 configs:
- base config (vue linting, typescript, javascript linting)
- only vue-html linting
- only typescript linting
- only javascript linting
#### Content:
- [⚙ Eslint config integration](#eslint-config-integration)
- [◉ Eslint config options](#eslint-config-options)

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.

## Eslint config integration

First, what you need is to install npm package.
```bash
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`
```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": [
"@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
```json
{
"root": true,
"parserOptions": {
"project": "./tsconfig.json",
"sourceType": "module",
"extraFileExtensions": [".vue"]
},
"extends": [
"@spacetabs/eslint-config-spacetab-io"
]
}
```

[⬆ Go top](#eslint-config-by-spacetabio)

---

## Eslint config options

### Here we have 3 configs:

#### base
- vue linting
- typescript
- javascript linting

Usage:
```json
{
"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.
#### only vue html
Usage:
```json
{
"extends": ["@spacetabs/eslint-config-spacetab-io/vue-html"]
}
```

#### only typescript
Usage:
```json
{
"extends": ["@spacetabs/eslint-config-spacetab-io/typescript"]
}
```

#### only javascript
Usage:
```json
{
"extends": ["@spacetabs/eslint-config-spacetab-io/javascript"]
}
```

[⬆ Go top](#eslint-config-by-spacetabio)
31 changes: 31 additions & 0 deletions packages/stylelint-config-spacetab-io/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,34 @@

> if you can write "hello world" you can change the world
> ###### Raghu Venkatesh

## Stylelint config integration

First, what you need is to install npm package.
```bash
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`
```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": ["@spacetabs/stylelint-config-spacetab-io"]
}
```

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


[⬆ Go top](#stylelint-config-by-spacetabio)

0 comments on commit 0b0e4ba

Please sign in to comment.