File tree 5 files changed +38
-3
lines changed
5 files changed +38
-3
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,7 @@ module.exports = {
69
69
'no-cond-assign' : [ WARNING , 'always' ] ,
70
70
'no-const-assign' : WARNING ,
71
71
'no-control-regex' : WARNING ,
72
+ 'no-css-modules' : WARNING ,
72
73
'no-delete-var' : WARNING ,
73
74
'no-dupe-args' : WARNING ,
74
75
'no-dupe-class-members' : WARNING ,
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Copyright (c) 2015-present, Facebook, Inc.
3
+ * All rights reserved.
4
+ *
5
+ * This source code is licensed under the BSD-style license found in the
6
+ * LICENSE file in the root directory of this source tree. An additional grant
7
+ * of patent rights can be found in the PATENTS file in the same directory.
8
+ */
9
+
10
+ module . exports = {
11
+ create : function ( context ) {
12
+ return {
13
+ ImportDeclaration : function ( node ) {
14
+ if ( node ) {
15
+ var specifiers = node . specifiers || [ ] ;
16
+ var value = node . source && node . source . value ;
17
+
18
+ if ( value && value . indexOf ( '.css' ) !== - 1 && specifiers . length ) {
19
+ for ( var i = 0 ; i < specifiers . length ; i ++ ) {
20
+ var specifier = specifiers [ i ] ;
21
+
22
+ context . report ( specifier , 'CSS modules import is restricted. ' +
23
+ 'Please remove the \'{{importName}}\' portion of the import.' , {
24
+ importName : specifier . imported ? specifier . imported . name : specifier . local . name
25
+ } ) ;
26
+ }
27
+ }
28
+ }
29
+ }
30
+ } ;
31
+ }
32
+ } ;
Original file line number Diff line number Diff line change @@ -86,7 +86,8 @@ module.exports = {
86
86
} ,
87
87
eslint : {
88
88
configFile : path . join ( __dirname , 'eslint.js' ) ,
89
- useEslintrc : false
89
+ useEslintrc : false ,
90
+ rulesdir : 'config/rules'
90
91
} ,
91
92
postcss : function ( ) {
92
93
return [ autoprefixer ] ;
Original file line number Diff line number Diff line change @@ -87,7 +87,8 @@ module.exports = {
87
87
// TODO: consider separate config for production,
88
88
// e.g. to enable no-console and no-debugger only in prod.
89
89
configFile : path . join ( __dirname , 'eslint.js' ) ,
90
- useEslintrc : false
90
+ useEslintrc : false ,
91
+ rulesdir : 'config/rules'
91
92
} ,
92
93
postcss : function ( ) {
93
94
return [ autoprefixer ] ;
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ npm install
31
31
scripts_path=$PWD /` npm pack`
32
32
33
33
# lint
34
- ./node_modules/.bin/eslint --ignore-path .gitignore ./
34
+ ./node_modules/.bin/eslint --rulesdir config/rules -- ignore-path .gitignore ./
35
35
36
36
# Test local start command
37
37
npm start -- --smoke-test
You can’t perform that action at this time.
0 commit comments