Skip to content

Commit 509d074

Browse files
authored
Fixed to work with CI. (#5)
* CI * update docs * update doc
1 parent f62d4de commit 509d074

File tree

10 files changed

+34
-18
lines changed

10 files changed

+34
-18
lines changed

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
[![NPM downloads](https://img.shields.io/npm/dm/eslint-plugin-vue-scoped-css.svg)](http://www.npmtrends.com/eslint-plugin-vue-scoped-css)
1010
[![NPM downloads](https://img.shields.io/npm/dy/eslint-plugin-vue-scoped-css.svg)](http://www.npmtrends.com/eslint-plugin-vue-scoped-css)
1111
[![NPM downloads](https://img.shields.io/npm/dt/eslint-plugin-vue-scoped-css.svg)](http://www.npmtrends.com/eslint-plugin-vue-scoped-css)
12+
[![Build Status](https://travis-ci.com/ota-meshi/eslint-plugin-vue-scoped-css.svg?branch=master)](https://travis-ci.com/ota-meshi/eslint-plugin-vue-scoped-css)
1213
<!--
13-
[![Build Status](https://travis-ci.org/ota-meshi/eslint-plugin-vue-scoped-css.svg?branch=master)](https://travis-ci.org/ota-meshi/eslint-plugin-vue-scoped-css)
1414
[![Coverage Status](https://coveralls.io/repos/github/ota-meshi/eslint-plugin-vue-scoped-css/badge.svg?branch=master)](https://coveralls.io/github/ota-meshi/eslint-plugin-vue-scoped-css?branch=master)
1515
[![Greenkeeper badge](https://badges.greenkeeper.io/ota-meshi/eslint-plugin-vue-scoped-css.svg)](https://greenkeeper.io/)
1616
-->
@@ -19,6 +19,9 @@
1919

2020
This ESLint plugin provides linting rules specific to [Scoped CSS in Vue.js].
2121

22+
- Enforce best practices for Scoped CSS.
23+
- Supports CSS and SCSS syntax.
24+
2225
You can check on the [Online DEMO](https://ota-meshi.github.io/eslint-plugin-vue-scoped-css/playground/).
2326

2427
<!--DOCS_IGNORE_START-->
@@ -59,8 +62,8 @@ module.exports = {
5962

6063
This plugin provides 3 predefined configs:
6164

62-
- `plugin:vue-scoped-css/base` - Settings and rules to enable correct ESLint parsing
63-
- `plugin:vue-scoped-css/recommended` - Above, plus rules to improve code experience
65+
- `plugin:vue-scoped-css/base` - Settings and rules to enable this plugin
66+
- `plugin:vue-scoped-css/recommended` - Above, plus rules for better ways to help you avoid problems
6467
- `plugin:vue-scoped-css/all` - All rules of this plugin are included
6568

6669
## Rules
@@ -71,7 +74,7 @@ The `--fix` option on the [command line](https://eslint.org/docs/user-guide/comm
7174

7275
<!--RULES_TABLE_START-->
7376

74-
### Base Rules (Enabling Correct ESLint Parsing)
77+
### Base Rules (Enabling Plugin)
7578

7679
Enable this plugin using with:
7780

@@ -81,7 +84,7 @@ Enable this plugin using with:
8184
}
8285
```
8386

84-
### Recommended (Improve Development Experience)
87+
### Recommended
8588

8689
Enforce all the rules in this category with:
8790

docs/.vuepress/categories.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
const { rules } = require("../../dist/utils/rules")
22

33
const categoryTitles = {
4-
base: "Base Rules (Enabling Correct ESLint Parsing)",
5-
recommended: "Recommended (Improve Development Experience)",
4+
base: "Base Rules (Enabling Plugin)",
5+
recommended: "Recommended",
66
}
77

88
const categoryConfigDescriptions = {

docs/README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
[![NPM downloads](https://img.shields.io/npm/dm/eslint-plugin-vue-scoped-css.svg)](http://www.npmtrends.com/eslint-plugin-vue-scoped-css)
1010
[![NPM downloads](https://img.shields.io/npm/dy/eslint-plugin-vue-scoped-css.svg)](http://www.npmtrends.com/eslint-plugin-vue-scoped-css)
1111
[![NPM downloads](https://img.shields.io/npm/dt/eslint-plugin-vue-scoped-css.svg)](http://www.npmtrends.com/eslint-plugin-vue-scoped-css)
12+
[![Build Status](https://travis-ci.com/ota-meshi/eslint-plugin-vue-scoped-css.svg?branch=master)](https://travis-ci.com/ota-meshi/eslint-plugin-vue-scoped-css)
1213
<!--
13-
[![Build Status](https://travis-ci.org/ota-meshi/eslint-plugin-vue-scoped-css.svg?branch=master)](https://travis-ci.org/ota-meshi/eslint-plugin-vue-scoped-css)
1414
[![Coverage Status](https://coveralls.io/repos/github/ota-meshi/eslint-plugin-vue-scoped-css/badge.svg?branch=master)](https://coveralls.io/github/ota-meshi/eslint-plugin-vue-scoped-css?branch=master)
1515
[![Greenkeeper badge](https://badges.greenkeeper.io/ota-meshi/eslint-plugin-vue-scoped-css.svg)](https://greenkeeper.io/)
1616
-->
@@ -19,6 +19,9 @@
1919

2020
This ESLint plugin provides linting rules specific to [Scoped CSS in Vue.js].
2121

22+
- Enforce best practices for Scoped CSS.
23+
- Supports CSS and SCSS syntax.
24+
2225
You can check on the [Online DEMO](./playground/).
2326

2427
## Installation
@@ -51,8 +54,8 @@ module.exports = {
5154

5255
This plugin provides 3 predefined configs:
5356

54-
- `plugin:vue-scoped-css/base` - Settings and rules to enable correct ESLint parsing
55-
- `plugin:vue-scoped-css/recommended` - Above, plus rules to improve code experience
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
5659
- `plugin:vue-scoped-css/all` - All rules of this plugin are included
5760

5861
## Rules

docs/rules/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ sidebarDepth: 0
66

77
<!-- This file is automatically generated in tools/update-docs-rules-index.js, do not change! -->
88

9-
## Base Rules (Enabling Correct ESLint Parsing)
9+
## Base Rules (Enabling Plugin)
1010

1111
Enable this plugin using with:
1212

@@ -16,7 +16,7 @@ Enable this plugin using with:
1616
}
1717
```
1818

19-
## Recommended (Improve Development Experience)
19+
## Recommended
2020

2121
Enforce all the rules in this category with:
2222

lib/types.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,14 @@ export interface VDirectiveKeyV5 extends AST.HasLocation, AST.HasParent {
3030
type: "VDirectiveKey"
3131
name: string
3232
argument: string | null
33-
modifiers: [string]
33+
modifiers: string[]
34+
parent: AST.VAttribute
3435
shorthand: boolean
36+
raw: {
37+
name: string
38+
argument: string | null
39+
modifiers: string[]
40+
}
3541
}
3642
export interface VDirectiveKeyV6 extends AST.HasLocation, AST.HasParent {
3743
type: "VDirectiveKey"

package-lock.json

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262
"mocha": "^6.2.2",
6363
"nyc": "^14.1.1",
6464
"pack": "^2.2.0",
65-
"postcss-safe-parser": "^4.0.1",
6665
"raw-loader": "^3.1.0",
6766
"rimraf": "^3.0.0",
6867
"ts-node": "^8.4.1",
@@ -74,6 +73,7 @@
7473
"eslint-utils": "^1.4.3",
7574
"lodash": "^4.17.15",
7675
"postcss": "^7.0.21",
76+
"postcss-safe-parser": "^4.0.1",
7777
"postcss-scss": "^2.0.0",
7878
"postcss-selector-parser": "^6.0.2",
7979
"vue-eslint-parser": "^5.0.0 || ^6.0.0 || ^7.0.0"

tests/lib/rules/no-parsing-error.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const tester = new RuleTester({
1212
tester.run("no-parsing-error", rule, {
1313
valid: [
1414
`
15+
<template><!-- When using vue-eslint-parser@5, a template tag is required. --></template>
1516
<style scoped>
1617
.item {}
1718
</style>
@@ -20,14 +21,15 @@ tester.run("no-parsing-error", rule, {
2021
invalid: [
2122
{
2223
code: `
24+
<template><!-- When using vue-eslint-parser@5, a template tag is required. --></template>
2325
<style scoped>
2426
.item {
2527
</style>
2628
`,
2729
errors: [
2830
{
2931
message: "Parsing error: Unclosed block.",
30-
line: 3,
32+
line: 4,
3133
column: 13,
3234
},
3335
],

tests/lib/styles/parser/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ describe("CSS Nodes Test.", () => {
6666
if (!style.cssNode) {
6767
throw new Error("invalid")
6868
}
69+
if (style.cssNode.errors.length) {
70+
return
71+
}
6972
checkCSSNodeLocations(source, style.cssNode, style.lang)
7073
})
7174
it("should be parsed to valid AST.", () => {

tools/lib/categories.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { rules } from "../../lib/utils/rules"
22
import { Rule } from "../../lib/types"
33

44
const categoryTitles = {
5-
base: "Base Rules (Enabling Correct ESLint Parsing)",
6-
recommended: "Recommended (Improve Development Experience)",
5+
base: "Base Rules (Enabling Plugin)",
6+
recommended: "Recommended",
77
} as { [key: string]: string }
88

99
const categoryConfigDescriptions = {

0 commit comments

Comments
 (0)