This repository was archived by the owner on Oct 19, 2020. It is now read-only.
File tree 8 files changed +1178
-346
lines changed
8 files changed +1178
-346
lines changed Original file line number Diff line number Diff line change 1
1
language : node_js
2
2
node_js :
3
- - ' 6'
3
+ - ' 8'
4
+ - ' 10'
4
5
cache :
5
6
yarn : true
6
7
script :
Original file line number Diff line number Diff line change 1
- FROM node:8
1
+ FROM node:10
2
+
3
+ WORKDIR /app
4
+
5
+ # Install dependencies
6
+ COPY package.json yarn.* ./
7
+ RUN yarn install
8
+
9
+ # Copy our code on top
10
+ COPY lib ./lib
11
+ COPY bin ./bin
12
+
13
+ ENTRYPOINT ["bin/sass-lint-vue" ]
Original file line number Diff line number Diff line change
1
+ version : ' 3'
2
+ services :
3
+ app :
4
+ build : .
5
+ volumes :
6
+ - ./:/app
7
+ entrypoint : tail -F /dev/null
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ class Linter {
54
54
const fileErrors = sassLint . lintText ( {
55
55
text : template . content ,
56
56
filename : filePath ,
57
- format : 'scss'
57
+ format : template . format
58
58
} )
59
59
60
60
if ( fileErrors . messages . length ) {
@@ -83,16 +83,23 @@ class Linter {
83
83
}
84
84
85
85
const $ = cheerio . load ( dom )
86
- const template = $ ( 'style[lang="scss"]' ) . text ( )
87
-
88
- if ( template . length <= 0 ) {
89
- return
86
+ const scssTemplate = $ ( 'style[lang="scss"]' ) . text ( )
87
+ const sassTemplate = $ ( 'style[lang="sass"]' ) . text ( )
88
+
89
+ if ( scssTemplate . length ) {
90
+ templates . push ( {
91
+ content : scssTemplate ,
92
+ format : 'scss' ,
93
+ lineOffset : this . getLineOffset ( scssTemplate , $ . text ( ) )
94
+ } )
95
+ }
96
+ if ( sassTemplate . length ) {
97
+ templates . push ( {
98
+ content : sassTemplate ,
99
+ format : 'sass' ,
100
+ lineOffset : this . getLineOffset ( sassTemplate , $ . text ( ) )
101
+ } )
90
102
}
91
-
92
- templates . push ( {
93
- content : template ,
94
- lineOffset : this . getLineOffset ( template , $ . text ( ) )
95
- } )
96
103
} )
97
104
98
105
var parser = new htmlparser . Parser ( handler )
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " sass-lint-vue" ,
3
- "version" : " 0.3.3 " ,
3
+ "version" : " 0.4.0 " ,
4
4
"description" : " Command line tool to lint Sass styles in Vue single file components." ,
5
5
"keywords" : [
6
6
" lint" ,
33
33
"chalk" : " ^2.4.1" ,
34
34
"cheerio" : " ^1.0.0-rc.2" ,
35
35
"commander" : " ^2.18.0" ,
36
- "eslint" : " ^3.14.1" ,
37
- "eslint-config-standard" : " ^6.2.1" ,
38
- "eslint-plugin-promise" : " ^3.4.0" ,
39
- "eslint-plugin-standard" : " ^2.0.1" ,
40
36
"htmlparser2" : " ^3.9.2" ,
41
37
"sass-lint" : " ^1.12.1" ,
42
38
"text-table" : " ^0.2.0" ,
43
39
"walk" : " ^2.3.14"
44
40
},
45
41
"devDependencies" : {
46
- "husky" : " ^1.0.1"
42
+ "eslint" : " ^5.16.0" ,
43
+ "eslint-config-standard" : " ^12.0.0" ,
44
+ "eslint-plugin-import" : " ^2.17.3" ,
45
+ "eslint-plugin-node" : " ^9.1.0" ,
46
+ "eslint-plugin-promise" : " ^4.1.1" ,
47
+ "eslint-plugin-standard" : " ^4.0.0" ,
48
+ "husky" : " ^2.4.1"
47
49
}
48
50
}
Original file line number Diff line number Diff line change @@ -39,20 +39,27 @@ sass-lint-vue assets
39
39
40
40
## Development
41
41
42
- Build the docker container via
42
+ Build the docker container via:
43
43
44
44
``` bash
45
- docker build . -t sass-lint-vue.
45
+ $ docker build . -t sass-lint-vue
46
46
```
47
47
48
48
Lint the ` Component.vue ` file in the docker container via:
49
49
50
50
``` bash
51
- docker run --rm -v (pwd):/app sass-lint-vue ./app/bin/sass-lint-vue ./app/ test/Component.vue
51
+ $ docker run --rm -tv $ ( pwd) /test :/app/test sass-lint-vue test
52
52
```
53
53
54
54
Access the container via:
55
55
56
56
``` bash
57
- docker run -it --rm -v (pwd):/app sass-lint-vue bash
57
+ $ docker run -it --rm -v $( pwd) /test:/app/test --entrypoint bash sass-lint-vue
58
+ ```
59
+
60
+ Use docker compose to work on the files:
61
+
62
+ ```
63
+ $ docker-compose up
64
+ $ docker-compose exec app bash
58
65
```
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <div class =" wrapper" ></div >
3
+ </template >
4
+ <script >
5
+ export default {
6
+
7
+ }
8
+ </script >
9
+ <style lang="sass">
10
+ .wrapper
11
+ $black : #000
12
+
13
+ background : $black
14
+ </style >
You can’t perform that action at this time.
0 commit comments