Skip to content

Commit 8d94e8c

Browse files
authored
Update documents (#12)
1 parent e869d4a commit 8d94e8c

File tree

16 files changed

+534
-257
lines changed

16 files changed

+534
-257
lines changed

.eslintrc.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,10 @@ module.exports = {
3434
files: ["lib/rules/**"],
3535
rules: {
3636
"@mysticatea/eslint-plugin/report-message-format": ["error", "[^a-z].*\\.$"],
37-
"@mysticatea/eslint-plugin/require-meta-docs-url": [
38-
"error",
39-
{
40-
pattern: `https://future-architect.github.io/eslint-plugin-vue-scoped-css/rules/{{name}}.html`,
41-
},
42-
],
37+
"require-meta-docs-url": ["warn", {
38+
pattern: `https://future-architect.github.io/eslint-plugin-vue-scoped-css/rules/{{name}}.html`,
39+
}],
40+
"@mysticatea/eslint-plugin/require-meta-docs-url": "off",
4341
}
4442
},
4543
{

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
{ "language": "vue", "autoFix": true },
66
{ "autoFix": true, "language": "typescript" },
77
],
8+
"eslint.options": {
9+
"rulePaths": ["eslint-internal-rules"]
10+
},
811
"typescript.validate.enable": true,
912
"javascript.validate.enable": false,
1013
"eslint.autoFixOnSave": true,

README.md

Lines changed: 42 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@
1717

1818
## Features
1919

20-
This ESLint plugin provides linting rules specific to [Scoped CSS in Vue.js].
20+
This ESLint plugin provides linting rules relate to better ways to help you avoid problems when using [Scoped CSS in Vue.js].
2121

22-
- Enforce best practices for Scoped CSS.
23-
- Supports CSS and SCSS syntax.
22+
- Provides linting rules for Scoped CSS.
23+
- Supports CSS syntax including level 4 selectors.
24+
- Supports `<style lang="scss">`.
25+
- Parses `<style>`, `<template>` and `<script>` blocks.
2426

2527
You can check on the [Online DEMO](https://future-architect.github.io/eslint-plugin-vue-scoped-css/playground/).
2628

@@ -30,16 +32,23 @@ You can check on the [Online DEMO](https://future-architect.github.io/eslint-plu
3032

3133
See [documents](https://future-architect.github.io/eslint-plugin-vue-scoped-css/).
3234

33-
<!--DOCS_IGNORE_END-->
34-
3535
## Installation
3636

3737
```bash
38-
npm install --save-dev eslint-plugin-vue-scoped-css
38+
npm install --save-dev eslint eslint-plugin-vue-scoped-css
3939
```
4040

41+
> **Requirements**
42+
>
43+
> - ESLint v5.0.0 and above
44+
> - Node.js v8.10.0 and above
45+
46+
<!--DOCS_IGNORE_END-->
47+
4148
## Usage
4249

50+
<!--USAGE_SECTION_START-->
51+
4352
Create `.eslintrc.*` file to configure rules. See also: [http://eslint.org/docs/user-guide/configuring](http://eslint.org/docs/user-guide/configuring).
4453

4554
Example **.eslintrc.js**:
@@ -66,6 +75,8 @@ This plugin provides 3 predefined configs:
6675
- `plugin:vue-scoped-css/recommended` - Above, plus rules for better ways to help you avoid problems
6776
- `plugin:vue-scoped-css/all` - All rules of this plugin are included
6877

78+
<!--USAGE_SECTION_END-->
79+
6980
## Rules
7081

7182
<!--RULES_SECTION_START-->
@@ -74,42 +85,47 @@ The `--fix` option on the [command line](https://eslint.org/docs/user-guide/comm
7485

7586
<!--RULES_TABLE_START-->
7687

77-
### Base Rules (Enabling Plugin)
88+
## Recommended
7889

79-
Enable this plugin using with:
90+
Enforce all the rules in this category with:
8091

8192
```json
8293
{
83-
"extends": "plugin:vue-scoped-css/base"
94+
"extends": "plugin:vue-scoped-css/recommended"
8495
}
8596
```
8697

87-
### Recommended
98+
| Rule ID | Description | |
99+
|:--------|:------------|:---|
100+
| [vue-scoped-css/no-parsing-error](./no-parsing-error.md) | Disallow parsing errors in `<style>` | |
101+
| [vue-scoped-css/no-unused-keyframes](./no-unused-keyframes.md) | Reports the `@keyframes` is not used in Scoped CSS. | |
102+
| [vue-scoped-css/no-unused-selector](./no-unused-selector.md) | Reports selectors defined in Scoped CSS not used in `<template>`. | |
103+
| [vue-scoped-css/require-scoped](./require-scoped.md) | Enforce the `<style>` tags to has the `scoped` attribute. | |
88104

89-
Enforce all the rules in this category with:
105+
## Uncategorized
106+
107+
No preset enables the rules in this category.
108+
Please enable each rule if you want.
109+
110+
For example:
90111

91112
```json
92113
{
93-
"extends": "plugin:vue-scoped-css/recommended"
114+
"rules": {
115+
"vue-scoped-css/require-selector-used-inside": "error"
116+
}
94117
}
95118
```
96119

97-
| | Rule ID | Description |
98-
|:---|:--------|:------------|
99-
| | [vue-scoped-css/no-parsing-error](./docs/rules/no-parsing-error.md) | Disallow parsing errors in `<style>` |
100-
| | [vue-scoped-css/no-unused-keyframes](./docs/rules/no-unused-keyframes.md) | Reports the `@keyframes` is not used in Scoped CSS. |
101-
| | [vue-scoped-css/no-unused-selector](./docs/rules/no-unused-selector.md) | Reports selectors defined in Scoped CSS not used in `<template>`. |
102-
| | [vue-scoped-css/require-scoped](./docs/rules/require-scoped.md) | Enforce the `<style>` tags to has the `scoped` attribute. |
103-
104-
### Uncategorized
105-
106-
| | Rule ID | Description |
107-
|:---|:--------|:------------|
108-
| | [vue-scoped-css/require-selector-used-inside](./docs/rules/require-selector-used-inside.md) | Reports the defined selectors is not used inside `<template>`. |
120+
| Rule ID | Description | |
121+
|:--------|:------------|:---|
122+
| [vue-scoped-css/require-selector-used-inside](./require-selector-used-inside.md) | Reports the defined selectors is not used inside `<template>`. | |
109123

110124
<!--RULES_TABLE_END-->
111125
<!--RULES_SECTION_END-->
112126

127+
<!--DOCS_IGNORE_START-->
128+
113129
## Contributing
114130

115131
Welcome contributing!
@@ -121,6 +137,8 @@ Please use GitHub's Issues/PRs.
121137
- `npm test` runs tests and measures coverage.
122138
- `npm run update` runs in order to update readme and recommended configuration.
123139

140+
<!--DOCS_IGNORE_END-->
141+
124142
## License
125143

126144
See the [LICENSE](LICENSE) file for license rights and limitations (MIT).

docs/.vuepress/config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ module.exports = {
6464
},
6565

6666
nav: [
67+
{ text: "Introduction", link: "/" },
68+
{ text: "User Guide", link: "/user-guide/" },
6769
{ text: "Rules", link: "/rules/" },
6870
{ text: "Playground", link: "/playground/" },
6971
],
@@ -90,7 +92,7 @@ module.exports = {
9092
// Rules in no category.
9193
...extraCategories,
9294
],
93-
"/": ["/", "/rules/", "/playground/"],
95+
"/": ["/", "/user-guide/", "/rules/", "/playground/"],
9496
},
9597
},
9698
}

docs/README.md

Lines changed: 7 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -17,61 +17,22 @@
1717

1818
## Features
1919

20-
This ESLint plugin provides linting rules specific to [Scoped CSS in Vue.js].
20+
This ESLint plugin provides linting rules relate to better ways to help you avoid problems when using [Scoped CSS in Vue.js].
2121

22-
- Enforce best practices for Scoped CSS.
23-
- Supports CSS and SCSS syntax.
22+
- Provides linting rules for Scoped CSS.
23+
- Supports CSS syntax including level 4 selectors.
24+
- Supports `<style lang="scss">`.
25+
- Parses `<style>`, `<template>` and `<script>` blocks.
2426

2527
You can check on the [Online DEMO](./playground/).
2628

27-
## Installation
28-
29-
```bash
30-
npm install --save-dev eslint-plugin-vue-scoped-css
31-
```
32-
3329
## Usage
3430

35-
Create `.eslintrc.*` file to configure rules. See also: [http://eslint.org/docs/user-guide/configuring](http://eslint.org/docs/user-guide/configuring).
36-
37-
Example **.eslintrc.js**:
38-
39-
```js
40-
module.exports = {
41-
extends: [
42-
// add more generic rulesets here, such as:
43-
// 'eslint:recommended',
44-
'plugin:vue-scoped-css/recommended'
45-
],
46-
rules: {
47-
// override/add rules settings here, such as:
48-
// 'vue-scoped-css/no-unused-selector': 'error'
49-
}
50-
}
51-
```
52-
53-
## Configs
54-
55-
This plugin provides 3 predefined configs:
56-
57-
- `plugin:vue-scoped-css/base` - Settings and rules to enable this plugin
58-
- `plugin:vue-scoped-css/recommended` - Above, plus rules for better ways to help you avoid problems
59-
- `plugin:vue-scoped-css/all` - All rules of this plugin are included
31+
See [User Guide](./user-guide/README.md).
6032

6133
## Rules
6234

63-
[Available Rules](./rules/README.md).
64-
65-
## Contributing
66-
67-
Welcome contributing!
68-
69-
Please use GitHub's Issues/PRs.
70-
71-
### Development Tools
72-
73-
- `npm test` runs tests and measures coverage.
74-
- `npm run update` runs in order to update readme and recommended configuration.
35+
See [Available Rules](./rules/README.md).
7536

7637
## License
7738

0 commit comments

Comments
 (0)