Skip to content

Commit

Permalink
chore(deps): update eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinspecker committed Feb 24, 2016
1 parent 8c9ece5 commit b4a5d0c
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 178 deletions.
101 changes: 0 additions & 101 deletions .jscsrc

This file was deleted.

22 changes: 0 additions & 22 deletions .jshintrc

This file was deleted.

41 changes: 16 additions & 25 deletions gulpfile.babel.js
Original file line number Diff line number Diff line change
@@ -1,42 +1,33 @@
'use strict';
import babel from 'gulp-babel';
import babelCompiler from 'babel-core';
import del from 'del';
import gulp from 'gulp';
import eslint from 'gulp-eslint';
import istanbul from 'gulp-istanbul';
import jscs from 'gulp-jscs';
import jshint from 'gulp-jshint';
import mocha from 'gulp-mocha';
'use strict'
import babel from 'gulp-babel'
import babelCompiler from 'babel-core'
import del from 'del'
import gulp from 'gulp'
import eslint from 'gulp-eslint'
import istanbul from 'gulp-istanbul'
import mocha from 'gulp-mocha'

const configFiles = './gulpfile.babel.js'
, srcFiles = 'src/*.js'
, testFiles = 'test/*.js'

, destDir = './lib/';
, destDir = './lib/'

gulp.task('clean', () => del(destDir));
gulp.task('clean', () => del(destDir))

gulp.task('lint', ['clean'], () =>
gulp.src([configFiles, srcFiles, testFiles])
.pipe(eslint())
.pipe(eslint.formatEach('./node_modules/eslint-path-formatter'))
.pipe(eslint.failOnError())
.pipe(jscs())
.pipe(jscs.reporter())
.pipe(jscs.reporter('fail'))
.pipe(jshint())
.pipe(jshint.reporter('default'))
.pipe(jshint.reporter('fail'))
);
)

gulp.task('compile', ['lint'], () =>
gulp.src(srcFiles)
.pipe(babel())
.pipe(gulp.dest(destDir))
);
)

gulp.task('build', ['compile']);
gulp.task('build', ['compile'])

gulp.task('test', ['build'], cb => {
gulp.src([`${destDir}*.js`])
Expand All @@ -50,6 +41,6 @@ gulp.task('test', ['build'], cb => {
}
}))
.pipe(istanbul.writeReports())
.on('end', cb);
});
});
.on('end', cb)
})
})
10 changes: 3 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,13 @@
"chai": "^3.0.0",
"coveralls": "^2.11.2",
"del": "^2.0.0",
"eslint-config-dustinspecker": "^0.2.5",
"eslint-path-formatter": "^0.1.1",
"eslint-config-dustinspecker": "^0.4.1",
"eslint-plugin-new-with-error": "^1.1.0",
"eslint-plugin-no-use-extend-native": "^0.3.1",
"gulp": "^3.9.0",
"gulp-babel": "^6.0.0",
"gulp-eslint": "^1.0.0",
"gulp-eslint": "^2.0.0",
"gulp-istanbul": "^0.10.0",
"gulp-jscs": "^3.0.1",
"gulp-jshint": "^2.0.0",
"gulp-mocha": "^2.1.0",
"jshint": "^2.8.0"
"gulp-mocha": "^2.1.0"
}
}
10 changes: 5 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
import cssProperties from 'just-css-properties';
'use strict'
import cssProperties from 'just-css-properties'

/**
* Is property a valid CSS property?
Expand All @@ -9,8 +9,8 @@ import cssProperties from 'just-css-properties';
*/
module.exports = function (property) {
if (typeof property !== 'string') {
throw new TypeError('Expected property to be a string');
throw new TypeError('Expected property to be a string')
}

return cssProperties.indexOf(property.toLowerCase()) !== -1;
};
return cssProperties.indexOf(property.toLowerCase()) !== -1
}
34 changes: 16 additions & 18 deletions test/test.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,27 @@
/* global describe, it */
'use strict';
import {expect} from 'chai';
import isCssProperty from '../lib/';
'use strict'
import {expect} from 'chai'
import isCssProperty from '../lib/'

describe('is-css-property', () => {
it('should throw a TypeError if property is a string', () => {
function test() {
isCssProperty();
}
const test = () => isCssProperty()

expect(test).to.throw(TypeError, /Expected property to be a string/);
});
expect(test).to.throw(TypeError, /Expected property to be a string/)
})

it('should return false if property is not a valid CSS property', () => {
expect(isCssProperty('abe')).to.eql(false);
expect(isCssProperty('lincoln')).to.eql(false);
});
expect(isCssProperty('abe')).to.eql(false)
expect(isCssProperty('lincoln')).to.eql(false)
})

it('should return true if property is a valid CSS property', () => {
expect(isCssProperty('color')).to.eql(true);
expect(isCssProperty('float')).to.eql(true);
});
expect(isCssProperty('color')).to.eql(true)
expect(isCssProperty('float')).to.eql(true)
})

it('should lower case property', () => {
expect(isCssProperty('COLOR')).to.eql(true);
expect(isCssProperty('fLoAt')).to.eql(true);
});
});
expect(isCssProperty('COLOR')).to.eql(true)
expect(isCssProperty('fLoAt')).to.eql(true)
})
})

0 comments on commit b4a5d0c

Please sign in to comment.