Skip to content

Commit 8016694

Browse files
authored
Supports for Vue.js 3.x (#38)
* Supports for Vue.js 3.x ### Breaking Changes - Drop supports ESLint 5.x - Drop supports `vue-eslint-parser` 5.x and 6.x - Move "vue-eslint-parser" to "peerDependencies" - Upgrade deps ### Enhancements - Supports for Vue.js 3.x Scoped styles - Change `vue-scoped-css/no-unused-selector` rule to support `::v-deep()`,`::v-slotted()` and `::v-global` pseudo-classes. - Change `vue-scoped-css/require-selector-used-inside` rule to support `::v-deep()`,`::v-slotted()` and `::v-global` pseudo-classes. https://github.com/vuejs/rfcs/blob/master/active-rfcs/0023-scoped-styles-changes.md * downgrade mocha * update CI
1 parent 4e65b25 commit 8016694

File tree

94 files changed

+3815
-2145
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+3815
-2145
lines changed

.github/workflows/NodeCI.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v1
14+
- uses: actions/setup-node@v1
15+
with:
16+
node-version: 14
17+
- name: Install Packages
18+
run: npm install
19+
- name: Lint
20+
run: npm run lint
21+
test:
22+
runs-on: ubuntu-latest
23+
strategy:
24+
matrix:
25+
node-version: [10.13.x, 12.x, 13.x, 14.x]
26+
steps:
27+
- uses: actions/checkout@v1
28+
- name: Use Node.js ${{ matrix.node-version }}
29+
uses: actions/setup-node@v1
30+
with:
31+
node-version: ${{ matrix.node-version }}
32+
- name: Install Packages
33+
run: npm install
34+
- name: build
35+
run: npm run build
36+
- name: Test
37+
run: npm test
38+
test-with-eslint6:
39+
runs-on: ubuntu-latest
40+
steps:
41+
- uses: actions/checkout@v1
42+
- uses: actions/setup-node@v1
43+
with:
44+
node-version: 8.10.x
45+
- name: Install Target Packages
46+
run: |+
47+
npm i -D eslint@6.0.0
48+
npx rimraf node_modules
49+
npm install
50+
- name: Test
51+
run: npm test
52+
test-and-coverage:
53+
runs-on: ubuntu-latest
54+
steps:
55+
- uses: actions/checkout@v1
56+
- uses: actions/setup-node@v1
57+
- name: Install Packages
58+
run: npm install
59+
- name: Test
60+
run: npm run test:nyc
61+
- name: Install Coveralls
62+
run: npm i -D coveralls
63+
- name: Coveralls GitHub Action
64+
uses: coverallsapp/github-action@v1.1.1
65+
with:
66+
github-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/NpmPublish.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: publish
2+
on:
3+
push:
4+
tags:
5+
- "*"
6+
jobs:
7+
release:
8+
name: check version, and release
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: checkout
12+
uses: actions/checkout@v1
13+
- name: setup Node
14+
uses: actions/setup-node@v1
15+
with:
16+
registry-url: 'https://registry.npmjs.org'
17+
- name: Install Packages
18+
run: npm install
19+
- name: test
20+
run: npm run test
21+
- name: check can npm-publish
22+
run: npx can-npm-publish
23+
- name: build
24+
run: npm run build
25+
- name: release
26+
run: npm publish
27+
env:
28+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.travis.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
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/future-architect/eslint-plugin-vue-scoped-css.svg?branch=master)](https://travis-ci.com/future-architect/eslint-plugin-vue-scoped-css)
12+
[![Build Status](https://github.com/future-architect/eslint-plugin-vue-scoped-css/workflows/CI/badge.svg?branch=master)](https://github.com/future-architect/eslint-plugin-vue-scoped-css/actions?query=workflow%3ACI)
1313
[![Coverage Status](https://coveralls.io/repos/github/future-architect/eslint-plugin-vue-scoped-css/badge.svg?branch=master)](https://coveralls.io/github/future-architect/eslint-plugin-vue-scoped-css?branch=master)
1414
<!--
1515
[![Greenkeeper badge](https://badges.greenkeeper.io/future-architect/eslint-plugin-vue-scoped-css.svg)](https://greenkeeper.io/)
@@ -103,6 +103,23 @@ Enforce all the rules in this category with:
103103
| [vue-scoped-css/no-unused-selector](https://future-architect.github.io/eslint-plugin-vue-scoped-css/rules/no-unused-selector.html) | Reports selectors defined in Scoped CSS not used in `<template>`. | |
104104
| [vue-scoped-css/require-scoped](https://future-architect.github.io/eslint-plugin-vue-scoped-css/rules/require-scoped.html) | Enforce the `<style>` tags to has the `scoped` attribute. | |
105105

106+
## Recommended for Vue.js 3.x
107+
108+
Enforce all the rules in this category with:
109+
110+
```json
111+
{
112+
"extends": "plugin:vue-scoped-css/vue3-recommended"
113+
}
114+
```
115+
116+
| Rule ID | Description | |
117+
|:--------|:------------|:---|
118+
| [vue-scoped-css/no-parsing-error](https://future-architect.github.io/eslint-plugin-vue-scoped-css/rules/no-parsing-error.html) | Disallow parsing errors in `<style>` | |
119+
| [vue-scoped-css/no-unused-keyframes](https://future-architect.github.io/eslint-plugin-vue-scoped-css/rules/no-unused-keyframes.html) | Reports the `@keyframes` is not used in Scoped CSS. | |
120+
| [vue-scoped-css/no-unused-selector](https://future-architect.github.io/eslint-plugin-vue-scoped-css/rules/no-unused-selector.html) | Reports selectors defined in Scoped CSS not used in `<template>`. | |
121+
| [vue-scoped-css/require-scoped](https://future-architect.github.io/eslint-plugin-vue-scoped-css/rules/require-scoped.html) | Enforce the `<style>` tags to has the `scoped` attribute. | |
122+
106123
## Uncategorized
107124

108125
No preset enables the rules in this category.

deploy.sh

Lines changed: 0 additions & 10 deletions
This file was deleted.

docs/.vuepress/categories.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ for (const categoryId of Object.keys(categoryRules)) {
2727
}
2828
}
2929

30-
module.exports = categoryIds.map(categoryId => ({
30+
module.exports = categoryIds.map((categoryId) => ({
3131
categoryId,
3232
title: categoryTitles[categoryId],
3333
configDescription: categoryConfigDescriptions[categoryId],
3434
rules: (categoryRules[categoryId] || []).filter(
35-
rule => !rule.meta.deprecated
35+
(rule) => !rule.meta.deprecated
3636
),
3737
}))
3838
// .filter(category => category.rules.length >= 1)

docs/.vuepress/components/components/EslintPluginEditor.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export default {
129129
130130
const vm = this
131131
const verifyAndFix = linter.verifyAndFix.bind(linter)
132-
linter.verifyAndFix = function(...args) {
132+
linter.verifyAndFix = function (...args) {
133133
args[2].preprocess = vm.preprocess
134134
args[2].postprocess = vm.postprocess
135135
return verifyAndFix(...args)

docs/.vuepress/components/components/RulesSettings.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@
1111
<label class="category-title">
1212
<input
1313
:checked="
14-
category.rules.every(rule =>
14+
category.rules.every((rule) =>
1515
isErrorState(rule.ruleId)
1616
)
1717
"
1818
type="checkbox"
1919
:indeterminate.prop="
20-
!category.rules.every(rule =>
20+
!category.rules.every((rule) =>
2121
isErrorState(rule.ruleId)
2222
) &&
23-
!category.rules.every(
24-
rule => !isErrorState(rule.ruleId)
25-
)
23+
!category.rules.every(
24+
(rule) => !isErrorState(rule.ruleId)
25+
)
2626
"
2727
@input="onAllClick(category, $event)"
2828
/>

docs/.vuepress/components/components/SnsBar.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function setup() {
4444
clearTimeout(timeoutId)
4545
}
4646
timeoutId = setTimeout(() => {
47-
;(function(d, s, id) {
47+
;(function (d, s, id) {
4848
const [fjs] = d.getElementsByTagName(s)
4949
if (d.getElementById(id)) {
5050
return
@@ -54,7 +54,7 @@ function setup() {
5454
js.src = "https://buttons.github.io/buttons.js"
5555
fjs.parentNode.insertBefore(js, fjs)
5656
})(document, "script", "gh-buttons")
57-
;(function(d, s, id) {
57+
;(function (d, s, id) {
5858
const [fjs] = d.getElementsByTagName(s)
5959
if (d.getElementById(id)) {
6060
return
@@ -65,7 +65,7 @@ function setup() {
6565
"https://connect.facebook.net/ja_JP/sdk.js#xfbml=1&version=v2.10"
6666
fjs.parentNode.insertBefore(js, fjs)
6767
})(document, "script", "facebook-jssdk")
68-
;(function(d, s, id) {
68+
;(function (d, s, id) {
6969
const [fjs] = d.getElementsByTagName(s)
7070
const p = /^http:/u.test(d.location) ? "http" : "https"
7171
if (!d.getElementById(id)) {

docs/.vuepress/components/eslint-code-block.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ export default {
4949
}
5050
return nodes
5151
.map(
52-
node => node.text || this.computeCodeFromSlot(node.children)
52+
(node) =>
53+
node.text || this.computeCodeFromSlot(node.children)
5354
)
5455
.join("")
5556
},

0 commit comments

Comments
 (0)