This repository was archived by the owner on Aug 7, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +36
-15
lines changed Expand file tree Collapse file tree 2 files changed +36
-15
lines changed Original file line number Diff line number Diff line change 1
1
'use babel' ;
2
2
3
- const GRAMMAR_SCOPES = [
4
- 'text.html.angular' ,
5
- 'text.html.basic' ,
6
- 'text.html.erb' ,
7
- 'text.html.gohtml' ,
8
- 'text.html.jsp' ,
9
- 'text.html.mustache' ,
10
- 'text.html.ruby'
11
- ] ;
3
+ import { CompositeDisposable } from 'atom' ;
4
+
5
+ const grammarScopes = [ ] ;
12
6
13
7
export function activate ( ) {
14
8
require ( 'atom-package-deps' ) . install ( 'linter-htmlhint' ) ;
9
+
10
+ const subscriptions = new CompositeDisposable ( ) ;
11
+ subscriptions . add ( atom . config . observe ( 'linter-htmlhint.enabledScopes' , scopes => {
12
+ // Remove any old scopes
13
+ grammarScopes . splice ( 0 , grammarScopes . length ) ;
14
+ // Add the current scopes
15
+ Array . prototype . push . apply ( grammarScopes , scopes ) ;
16
+ } ) ) ;
15
17
}
16
18
17
19
function getConfig ( filePath ) {
@@ -38,7 +40,7 @@ function getConfig(filePath) {
38
40
export function provideLinter ( ) {
39
41
return {
40
42
name : 'htmlhint' ,
41
- grammarScopes : GRAMMAR_SCOPES ,
43
+ grammarScopes,
42
44
scope : 'file' ,
43
45
lintOnFly : true ,
44
46
lint : editor => {
Original file line number Diff line number Diff line change 9
9
"url" : " https://github.com/AtomLinter/linter-htmlhint.git"
10
10
},
11
11
"engines" : {
12
- "atom" : " >=1.0.0 <2.0.0"
12
+ "atom" : " >=1.4.0 <2.0.0"
13
+ },
14
+ "configSchema" : {
15
+ "enabledScopes" : {
16
+ "description" : " List of scopes to run HTMLHint on, run `Editor: Log Cursor Scope` to determine the scopes for a file." ,
17
+ "type" : " array" ,
18
+ "default" : [
19
+ " text.html.angular" ,
20
+ " text.html.basic" ,
21
+ " text.html.erb" ,
22
+ " text.html.gohtml" ,
23
+ " text.html.jsp" ,
24
+ " text.html.mustache" ,
25
+ " text.html.ruby"
26
+ ],
27
+ "items" : {
28
+ "type" : " string"
29
+ }
30
+ }
13
31
},
14
32
"scripts" : {
15
33
"test" : " apm test" ,
40
58
"eslintConfig" : {
41
59
"rules" : {
42
60
"comma-dangle" : [
43
- 2 ,
61
+ " error " ,
44
62
" never"
45
63
],
46
- "global-require" : 0 ,
64
+ "global-require" : " off " ,
47
65
"import/no-unresolved" : [
48
- 2 ,
66
+ " error " ,
49
67
{
50
68
"ignore" : [
51
69
" atom"
52
70
]
53
71
}
54
- ]
72
+ ],
73
+ "import/no-extraneous-dependencies" : " off"
55
74
},
56
75
"extends" : " airbnb-base" ,
57
76
"globals" : {
You can’t perform that action at this time.
0 commit comments