Skip to content

Commit

Permalink
ensure sharable config works
Browse files Browse the repository at this point in the history
close #152
  • Loading branch information
shinnn committed Jul 4, 2016
1 parent 08b9212 commit b0c2816
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -45,6 +45,7 @@
"gulp-util": "^3.0.6"
},
"devDependencies": {
"@shinnn/eslint-config-node": "^2.0.0",
"babel-eslint": "^6.1.0",
"from2-string": "^1.1.0",
"gulp": "^3.9.0",
Expand Down
3 changes: 3 additions & 0 deletions test/fixtures/eslintrc-sharable-config.js
@@ -0,0 +1,3 @@
module.exports = {
extends: '@shinnn/node'
};
24 changes: 24 additions & 0 deletions test/linting.js
Expand Up @@ -41,6 +41,30 @@ describe('gulp-eslint plugin', () => {
}));
});

it('should support sharable config', done => {
eslint(path.resolve(__dirname, 'fixtures/eslintrc-sharable-config.js'))
.on('error', done)
.on('data', file => {
should.exist(file);
should.exist(file.contents);
should.exist(file.eslint);

file.eslint.messages
.should.be.instanceof(Array)
.and.have.lengthOf(1);

file.eslint.messages[0]
.should.have.properties('message', 'line', 'column')
.and.have.property('ruleId', 'eol-last');

done();
})
.end(new File({
path: 'test/fixtures/no-newline.js',
contents: new Buffer('console.log(\'Hi\');')
}));
});

it('should produce expected message via buffer', done => {
eslint({useEslintrc: false, rules: {strict: [2, 'global']}})
.on('error', done)
Expand Down

0 comments on commit b0c2816

Please sign in to comment.