File tree Expand file tree Collapse file tree 4 files changed +44
-3
lines changed Expand file tree Collapse file tree 4 files changed +44
-3
lines changed Original file line number Diff line number Diff line change 3
3
# See http://eslint.org/docs/developer-guide/shareable-configs
4
4
# Authored by Gabriel Lebec, 2016
5
5
6
- # ESLint version ~2.11 .1
6
+ # ESLint version ~2.13 .1
7
7
8
8
extends : eslint:recommended # overridden below unless new recommended rules are added before this doc is updated
9
9
Original file line number Diff line number Diff line change 2
2
var YAML = require ( 'yamljs' ) ;
3
3
var path = require ( 'path' ) ;
4
4
5
- module . exports = YAML . load ( path . join ( __dirname , 'eslintrc.yml' ) ) ;
5
+ module . exports = YAML . load ( path . join ( __dirname , '. eslintrc.yml' ) ) ;
Original file line number Diff line number Diff line change 4
4
"description" : " a complete starter ESLint config file to help students avoid errors and learn best practices" ,
5
5
"main" : " index.js" ,
6
6
"scripts" : {
7
- "test" : " echo \" Error: no test specified \" && exit 1 "
7
+ "test" : " mocha "
8
8
},
9
9
"repository" : {
10
10
"type" : " git" ,
33
33
"homepage" : " https://github.com/FullstackAcademy/eslint-config-fullstack#readme" ,
34
34
"dependencies" : {
35
35
"yamljs" : " ~0.2.7"
36
+ },
37
+ "devDependencies" : {
38
+ "chai" : " ^3.5.0" ,
39
+ "eslint" : " ~2.13.1" ,
40
+ "mocha" : " ^2.5.3"
36
41
}
37
42
}
Original file line number Diff line number Diff line change
1
+ /* eslint-disable global-require, no-unused-expressions */
2
+ var linter = require ( 'eslint' ) . linter ;
3
+ var expect = require ( 'chai' ) . expect ;
4
+
5
+ describe ( 'eslint-config-fullstack' , function ( ) {
6
+
7
+ var eConfigFs ;
8
+ before ( 'load the module' , function ( ) {
9
+ eConfigFs = require ( '../index.js' ) ;
10
+ } ) ;
11
+
12
+ it ( 'exports an object' , function ( ) {
13
+ expect ( eConfigFs ) . to . be . an ( 'object' ) ;
14
+ } ) ;
15
+
16
+ it ( 'extends the recommended ESLint config' , function ( ) {
17
+ expect ( eConfigFs . extends ) . to . equal ( 'eslint:recommended' ) ;
18
+ } ) ;
19
+
20
+ it ( 'has a `rules` property' , function ( ) {
21
+ expect ( eConfigFs ) . to . include . keys ( 'rules' ) ;
22
+ } ) ;
23
+
24
+ it ( 'works with eslint' , function ( ) {
25
+ var messsages = linter . verify ( 'var x = 1;' , eConfigFs ) ;
26
+ expect ( messsages ) . to . be . an ( 'array' ) ;
27
+ if ( messsages [ 0 ] ) expect ( messsages [ 0 ] . fatal ) . not . to . be . true ;
28
+ } ) ;
29
+
30
+ it ( 'has a parsing error for invalid source' , function ( ) {
31
+ var messsages = linter . verify ( 'if;' , eConfigFs ) ;
32
+ expect ( messsages ) . to . be . an ( 'array' ) ;
33
+ expect ( messsages [ 0 ] . fatal ) . to . be . true ;
34
+ } ) ;
35
+
36
+ } ) ;
You can’t perform that action at this time.
0 commit comments