Skip to content

Commit 06970e5

Browse files
committed
Revert "new configuration, linted, commit prehook"
This reverts commit 9f46863.
1 parent 82c6d21 commit 06970e5

10 files changed

+652
-564
lines changed

.jshintrc

-21
This file was deleted.

Gruntfile.js

+23-19
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,14 @@
2020
'pkg': grunt.file.readJSON('package.json'),
2121
'confs': {
2222
'dist': 'dist',
23+
'config': 'config',
2324
'css': 'src/css',
2425
'js': 'src/js',
2526
'serverPort': 8000
2627
},
27-
'jscs': {
28-
'src': '<%= confs.js %>/**/*.js',
29-
'options': {
30-
'config': '.jscsrc'
31-
}
32-
},
3328
'csslint': {
3429
'options': {
35-
'csslintrc': '.csslintrc'
30+
'csslintrc': '<%= confs.config %>/csslintrc.json'
3631
},
3732
'strict': {
3833
'src': [
@@ -42,7 +37,7 @@
4237
},
4338
'eslint': {
4439
'options': {
45-
'config': '.eslintrc'
40+
'config': '<%= confs.config %>/eslint.json'
4641
},
4742
'target': [
4843
'Gruntfile.js',
@@ -84,9 +79,24 @@
8479
'port': '<%= confs.serverPort %>',
8580
'base': '.',
8681
'keepalive': true,
87-
'middleware': function manageMiddlewares(connect, options, middlewares) {
82+
'middleware': function manageMiddlewares(connect, options) {
83+
var middlewares = []
84+
, directory = options.directory || options.base[options.base.length - 1];
85+
8886
// enable Angular's HTML5 mode
8987
middlewares.push(modRewrite(['!\\.html|\\.js|\\.svg|\\.css|\\.png|\\.gif$ /index.html [L]']));
88+
89+
if (!Array.isArray(options.base)) {
90+
options.base = [options.base];
91+
}
92+
options.base.forEach(function forEachOption(base) {
93+
// Serve static files.
94+
middlewares.push(connect.static(base));
95+
});
96+
97+
// Make directory browse-able.
98+
middlewares.push(connect.directory(directory));
99+
90100
return middlewares;
91101
}
92102
}
@@ -124,28 +134,22 @@
124134

125135
grunt.loadNpmTasks('grunt-contrib-csslint');
126136
grunt.loadNpmTasks('grunt-eslint');
127-
grunt.loadNpmTasks('grunt-jscs');
128-
129137
grunt.loadNpmTasks('grunt-contrib-uglify');
130138
grunt.loadNpmTasks('grunt-contrib-cssmin');
131139

132140
grunt.loadNpmTasks('grunt-concurrent');
133141
grunt.loadNpmTasks('grunt-contrib-connect');
134142
grunt.loadNpmTasks('grunt-contrib-watch');
135143

136-
grunt.registerTask('lint', [
137-
'jscs',
138-
'csslint',
139-
'eslint'
140-
]);
141-
142144
grunt.registerTask('default', [
143-
'lint',
145+
'csslint',
146+
'eslint',
144147
'concurrent:dev'
145148
]);
146149

147150
grunt.registerTask('prod', [
148-
'lint',
151+
'csslint',
152+
'eslint',
149153
'cssmin',
150154
'uglify'
151155
]);

assets/js/index.js

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/*global angular*/
2+
23
(function withAngular(angular) {
34
'use strict';
45

@@ -11,14 +12,14 @@
1112
'$timeout',
1213
function controllerCtrl($scope, $timeout) {
1314

14-
$scope.generateHTMLextra = function generateHTMLextra(item) {
15+
$scope.generateHTMLextra = function generateHTMLextra(item) {
1516

16-
return '<i>hello tooltip content' + item + '</i>';
17-
};
18-
$scope.items = ['1', '2', '4', '5'];
19-
$timeout(function tiggerTimeout() {
20-
$scope.items.push('7');
17+
return '<i>hello tooltip content' + item + '</i>';
18+
};
19+
$scope.items = ['1','2','4','5'];
20+
$timeout(function () {
21+
$scope.items.push('7');
2122
$scope.items.push('9');
22-
}, 5000);
23-
}]);
23+
}, 5000);
24+
}]);
2425
}(angular));
File renamed without changes.

config/eslint.json

+153
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
//http://eslint.org/docs/rules/
2+
{
3+
"rules": {
4+
"no-cond-assign": 2,
5+
"no-constant-condition": 2,
6+
"no-comma-dangle": 2,
7+
"no-control-regex": 2,
8+
"no-debugger": 2,
9+
"no-dupe-keys": 2,
10+
"no-empty": 2,
11+
"no-extra-semi": 2,
12+
"no-inner-declarations": 2,
13+
"no-invalid-regexp": 2,
14+
"no-negated-in-lhs": 2,
15+
"no-obj-calls": 2,
16+
"no-regex-spaces": 2,
17+
"no-sparse-arrays": 2,
18+
"no-unreachable": 2,
19+
"use-isnan": 2,
20+
"valid-typeof": 2,
21+
"camelcase": 2,
22+
"eqeqeq": 2,
23+
"no-plusplus": 2,
24+
"no-bitwise": 2,
25+
"block-scoped-var": 2,
26+
"consistent-return": 2,
27+
"curly": [
28+
2,
29+
"all"
30+
],
31+
"default-case": 2,
32+
"dot-notation": 2,
33+
"no-caller": 2,
34+
"no-div-regex": 2,
35+
"no-else-return": 2,
36+
"no-empty-label": 2,
37+
"no-eq-null": 2,
38+
"no-eval": 2,
39+
"no-extend-native": 2,
40+
"no-fallthrough": 2,
41+
"no-floating-decimal": 2,
42+
"no-implied-eval": 2,
43+
"no-labels": 2,
44+
"no-iterator": 2,
45+
"no-lone-blocks": 2,
46+
"no-loop-func": 2,
47+
"no-multi-str": 2,
48+
"no-native-reassign": 2,
49+
"no-new": 2,
50+
"no-new-func": 2,
51+
"no-new-wrappers": 2,
52+
"no-octal": 2,
53+
"no-octal-escape": 2,
54+
"no-proto": 2,
55+
"no-redeclare": 2,
56+
"no-return-assign": 2,
57+
"no-script-url": 2,
58+
"no-self-compare": 2,
59+
"no-sequences": 2,
60+
"no-unused-expressions": 2,
61+
"no-with": 2,
62+
"yoda": 2,
63+
"radix": 2,
64+
"wrap-iife": [
65+
2,
66+
"outside"
67+
],
68+
"global-strict": [2, "never"],
69+
"no-extra-strict": 2,
70+
"strict": 2,
71+
"no-catch-shadow": 2,
72+
"no-delete-var": 2,
73+
"no-label-var": 2,
74+
"no-shadow": 2,
75+
"no-shadow-restricted-names": 2,
76+
"no-undef": 2,
77+
"no-undef-init": 2,
78+
"no-unused-vars": [
79+
2,
80+
{
81+
"vars": "all",
82+
"args": "after-used"
83+
}
84+
],
85+
"no-use-before-define": 2,
86+
"brace-style": [
87+
2,
88+
"1tbs"
89+
],
90+
"consistent-this": [
91+
2,
92+
"that"
93+
],
94+
"new-cap": 2,
95+
"new-parens": 2,
96+
"no-nested-ternary": 2,
97+
"no-array-constructor": 2,
98+
"no-lonely-if": 2,
99+
"no-new-object": 2,
100+
"no-spaced-func": 2,
101+
"no-space-before-semi": 2,
102+
"no-underscore-dangle": 2,
103+
"no-wrap-func": 2,
104+
"quotes": [
105+
2,
106+
"single",
107+
"avoid-escape"
108+
],
109+
"quote-props": 2,
110+
"semi": [
111+
2,
112+
"always"
113+
],
114+
"space-after-keywords": [
115+
2,
116+
"always"
117+
],
118+
"space-in-brackets": [
119+
2,
120+
"never"
121+
],
122+
"space-infix-ops": 2,
123+
"space-return-throw-case": 2,
124+
"space-unary-ops": 2,
125+
"one-var": 2,
126+
"wrap-regex": 2,
127+
128+
"no-extra-boolean-cast": 1,
129+
"no-console": 1,
130+
"no-alert": 1,
131+
"no-empty-class": 1,
132+
"no-ex-assign": 1,
133+
"no-func-assign": 1,
134+
"valid-jsdoc": 1,
135+
"guard-for-in": 1,
136+
"no-warning-comments": [
137+
1,
138+
{
139+
"terms": ["todo", "fixme", "xxx"],
140+
"location": "anywhere"
141+
}
142+
],
143+
"func-style": [
144+
1,
145+
"expression"
146+
],
147+
"no-extra-parens": 1,
148+
"func-names": 1,
149+
150+
"no-ternary": 0,
151+
"sort-vars": 0
152+
}
153+
}

0 commit comments

Comments
 (0)