Skip to content

Commit 8bbace9

Browse files
committed
Fix #77 scss:unknown-pseudo: support for webpack css-loader
1 parent 3bf038d commit 8bbace9

File tree

5 files changed

+64
-2
lines changed

5 files changed

+64
-2
lines changed

css-frontend/src/main/java/org/sonar/css/model/pseudo/pseudofunction/StandardPseudoFunctionFactory.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,11 @@ public class StandardPseudoFunctionFactory {
3131
Current.class,
3232
Dir.class,
3333
Drop.class,
34+
Global.class,
3435
Has.class,
3536
Host.class,
3637
HostContext.class,
38+
Local.class,
3739
Lang.class,
3840
Matches.class,
3941
Not.class,
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* SonarQube CSS / SCSS / Less Analyzer
3+
* Copyright (C) 2013-2017 David RACODON
4+
* mailto: david.racodon@gmail.com
5+
*
6+
* This program is free software; you can redistribute it and/or
7+
* modify it under the terms of the GNU Lesser General Public
8+
* License as published by the Free Software Foundation; either
9+
* version 3 of the License, or (at your option) any later version.
10+
*
11+
* This program is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14+
* Lesser General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU Lesser General Public License
17+
* along with this program; if not, write to the Free Software Foundation,
18+
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19+
*/
20+
package org.sonar.css.model.pseudo.pseudofunction.standard;
21+
22+
import org.sonar.css.model.pseudo.pseudofunction.StandardPseudoFunction;
23+
24+
public class Global extends StandardPseudoFunction {
25+
26+
public Global() {
27+
addLinks("https://github.com/webpack-contrib/css-loader#scope");
28+
}
29+
30+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* SonarQube CSS / SCSS / Less Analyzer
3+
* Copyright (C) 2013-2017 David RACODON
4+
* mailto: david.racodon@gmail.com
5+
*
6+
* This program is free software; you can redistribute it and/or
7+
* modify it under the terms of the GNU Lesser General Public
8+
* License as published by the Free Software Foundation; either
9+
* version 3 of the License, or (at your option) any later version.
10+
*
11+
* This program is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14+
* Lesser General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU Lesser General Public License
17+
* along with this program; if not, write to the Free Software Foundation,
18+
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19+
*/
20+
package org.sonar.css.model.pseudo.pseudofunction.standard;
21+
22+
import org.sonar.css.model.pseudo.pseudofunction.StandardPseudoFunction;
23+
24+
public class Local extends StandardPseudoFunction {
25+
26+
public Local() {
27+
addLinks("https://github.com/webpack-contrib/css-loader#scope");
28+
}
29+
30+
}

css-frontend/src/test/java/org/sonar/css/model/pseudo/StandardPseudoComponentFactoryTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class StandardPseudoComponentFactoryTest {
2727

2828
@Test
2929
public void number_of_standard_pseudo_components() {
30-
assertEquals(76, StandardPseudoComponentFactory.getAll().size());
30+
assertEquals(78, StandardPseudoComponentFactory.getAll().size());
3131
}
3232

3333
}

css-frontend/src/test/java/org/sonar/css/model/pseudo/pseudofunction/StandardPseudoFunctionFactoryTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public void should_return_a_valid_has_pseudo_function_object_mix_uppercase_lower
6161

6262
@Test
6363
public void number_of_standard_pseudo_functions() {
64-
assertEquals(17, StandardPseudoFunctionFactory.getAll().size());
64+
assertEquals(19, StandardPseudoFunctionFactory.getAll().size());
6565
}
6666

6767
@Test

0 commit comments

Comments
 (0)