1
0
Fork 0
mirror of https://github.com/koalyptus/TableFilter.git synced 2024-05-18 14:26:40 +02:00

Initial commit

This commit is contained in:
Max Guglielmi 2016-02-16 18:41:47 +11:00
parent 1910d93b9f
commit 4e8d4ec9da
14 changed files with 78 additions and 51 deletions

42
.eslintrc Normal file
View file

@ -0,0 +1,42 @@
{
"parser": "babel-eslint",
"rules": {
"max-len": [2, 80, 2, {"ignoreUrls": true}],
"max-depth": [2, 7],
"no-underscore-dangle": 0,
"no-loop-func": 2,
"curly": 2,
"quotes": [2, "single"],
//"indent": [2, 4],
"no-trailing-spaces": 2,
"no-multi-spaces": 2,
"array-bracket-spacing": 2,
"new-cap": 2
//"camelcase": [2, {"properties": "always"}]
/*"-W024": true,
"scripturl": true,
"evil": true,
"curly": true,
"indent": 4,
"es3": true,
"esnext": true,
"unused": true,
"maxlen" : 80,
"trailing": true,
"quotmark": "single",
"immed": true,
"maxstatements": 172,
"maxdepth": 7,
"maxcomplexity": 87,*/
},
"ecmaFeatures": {
"modules": true
},
"env": {
"es6": true,
"browser": true,
"node": false
}
}

View file

@ -1,17 +0,0 @@
{
"-W024": true,
"scripturl": true,
"evil": true,
"curly": true,
"indent": 4,
"es3": true,
"esnext": true,
"unused": true,
"maxlen" : 80,
"trailing": true,
"quotmark": "single",
"immed": true,
"maxstatements": 172,
"maxdepth": 7,
"maxcomplexity": 87
}

View file

@ -11,15 +11,15 @@ module.exports = function (grunt) {
grunt.initConfig({
jshint: {
src: [
eslint: {
options: {
configFile: '.eslintrc'
},
target: [
'Gruntfile.js',
'webpack.config.js',
'src/**/*.js'
],
options: {
jshintrc: '.jshintrc'
}
]
},
qunit: {
@ -282,7 +282,7 @@ module.exports = function (grunt) {
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-eslint');
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-clean');
@ -302,11 +302,11 @@ module.exports = function (grunt) {
// Dev dev/build/watch cycle
grunt.registerTask('dev',
['jshint', 'webpack:dev', 'copy:dist', 'stylus:compile', 'watch:app']);
['eslint', 'webpack:dev', 'copy:dist', 'stylus:compile', 'watch:app']);
// Production build
grunt.registerTask('build',
['jshint', 'webpack:build', 'copy:dist', 'stylus:compile']);
['eslint', 'webpack:build', 'copy:dist', 'stylus:compile']);
// Build demos
grunt.registerTask('dev-demos', ['build-demos', 'watch:templates']);
@ -317,7 +317,7 @@ module.exports = function (grunt) {
grunt.registerTask('dev-modules', ['babel', 'copy:dist']);
// Tests
grunt.registerTask('test', ['jshint', 'connect', 'qunit:all']);
grunt.registerTask('test', ['eslint', 'connect', 'qunit:all']);
// Publish to gh-pages
grunt.registerTask('publish', 'Publish from CLI', [

View file

@ -1,6 +1,6 @@
{
"name": "tablefilter",
"version": "0.1.14",
"version": "0.1.15",
"description": "A Javascript library making HTML tables filterable and a bit more",
"license": "MIT",
"author": {
@ -29,19 +29,21 @@
},
"devDependencies": {
"babel-core": "^6.1.2",
"babel-eslint": "4.1.8",
"babel-loader": "^6.0.1",
"babel-preset-es2015": "^6.3.13",
"clean-webpack-plugin": "^0.1.3",
"eslint": "2.1.0",
"grunt": "^0.4.5",
"grunt-babel": "^6.0.0",
"grunt-contrib-clean": "^0.6.0",
"grunt-contrib-connect": "^0.10.1",
"grunt-contrib-copy": "^0.8.0",
"grunt-contrib-jshint": "^0.11.2",
"grunt-contrib-qunit": "^0.7.0",
"grunt-contrib-stylus": "^0.22.0",
"grunt-contrib-watch": "^0.6.1",
"grunt-esdoc": "^0.0.1",
"grunt-eslint": "18.0.0",
"grunt-gh-pages": "^0.10.0",
"grunt-string-replace": "^1.2.0",
"grunt-webpack": "^1.0.8",

View file

@ -95,30 +95,30 @@ export default {
oDate = new Date(y2kDate(parts[2]),mmm2mm(parts[1])-1,parts[0]);
break;
case 'DMY':
/* jshint ignore:start */
/* eslint-disable */
parts = dateStr.replace(
/^(0?[1-9]|[12][0-9]|3[01])([- \/.])(0?[1-9]|1[012])([- \/.])((\d\d)?\d\d)$/,'$1 $3 $5').split(' ');
oDate = new Date(y2kDate(parts[2]),parts[1]-1,parts[0]);
/* jshint ignore:end */
/* eslint-enable */
break;
case 'MDY':
/* jshint ignore:start */
/* eslint-disable */
parts = dateStr.replace(
/^(0?[1-9]|1[012])([- \/.])(0?[1-9]|[12][0-9]|3[01])([- \/.])((\d\d)?\d\d)$/,'$1 $3 $5').split(' ');
oDate = new Date(y2kDate(parts[2]),parts[0]-1,parts[1]);
/* jshint ignore:end */
/* eslint-enable */
break;
case 'YMD':
/* jshint ignore:start */
/* eslint-disable */
parts = dateStr.replace(/^((\d\d)?\d\d)([- \/.])(0?[1-9]|1[012])([- \/.])(0?[1-9]|[12][0-9]|3[01])$/,'$1 $4 $6').split(' ');
oDate = new Date(y2kDate(parts[0]),parts[1]-1,parts[2]);
/* jshint ignore:end */
/* eslint-enable */
break;
default: //in case format is not correct
/* jshint ignore:start */
/* eslint-disable */
parts = dateStr.replace(/^(0?[1-9]|[12][0-9]|3[01])([- \/.])(0?[1-9]|1[012])([- \/.])((\d\d)?\d\d)$/,'$1 $3 $5').split(' ');
oDate = new Date(y2kDate(parts[2]),parts[1]-1,parts[0]);
/* jshint ignore:end */
/* eslint-enable */
break;
}
return oDate;