Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
brainfood
/
grunt-monty-python
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
567ac015
authored
2015-12-16 11:07:44 -0600
by
Adam Heath
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Refactor jshint block, to make it easier to add jscs block.
1 parent
1821b5a1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
29 deletions
grunt-monty-python.js
grunt-monty-python.js
View file @
567ac01
...
...
@@ -209,24 +209,22 @@ module.exports = function (grunt) {
});
}
function
js
hint
AddExtra
(
src
,
container
,
dest
)
{
function
js
checker
AddExtra
(
src
,
container
,
dest
)
{
if
(
src
)
{
container
[
dest
]
=
container
[
dest
].
concat
(
src
);
}
}
if
(
mpConfig
.
jshint
)
{
initConfig
.
jshint
=
{
options
:
mpConfig
.
jshint
.
options
,
function
createJschecker
(
name
,
browserOptions
,
modelOptions
,
viewOptions
)
{
if
(
!
mpConfig
[
name
])
{
return
;
}
initConfig
[
name
]
=
{
options
:
mpConfig
[
name
].
options
,
all
:
[
'Gruntfile.js'
,
],
main
:
{
options
:
_
.
extend
({},
mpConfig
.
jshint
.
browserOptions
,
{
globals
:
{
define
:
false
,
require
:
false
,
},
}),
options
:
_
.
extend
({},
mpConfig
[
name
].
browserOptions
,
browserOptions
),
files
:
{
src
:
[
mpConfig
.
base
+
'/scripts/*.js'
,
...
...
@@ -234,12 +232,7 @@ module.exports = function (grunt) {
},
},
model
:
{
options
:
_
.
extend
({},
mpConfig
.
jshint
.
modelOptions
||
mpConfig
.
jshint
.
browserOptions
,
{
globals
:
{
define
:
false
,
require
:
false
,
},
}),
options
:
_
.
extend
({},
mpConfig
[
name
].
modelOptions
,
modelOptions
,
mpConfig
[
name
].
browserOptions
,
browserOptions
),
files
:
{
src
:
[
mpConfig
.
base
+
'/scripts/model/**/*.js'
,
...
...
@@ -247,12 +240,7 @@ module.exports = function (grunt) {
},
},
view
:
{
options
:
_
.
extend
({},
mpConfig
.
jshint
.
viewOptions
||
mpConfig
.
jshint
.
browserOptions
,
{
globals
:
{
define
:
false
,
require
:
false
,
},
}),
options
:
_
.
extend
({},
mpConfig
[
name
].
viewOptions
,
viewOptions
,
mpConfig
[
name
].
browserOptions
,
browserOptions
),
files
:
{
src
:
[
mpConfig
.
base
+
'/scripts/view/**/*.js'
,
...
...
@@ -260,13 +248,23 @@ module.exports = function (grunt) {
},
},
};
jshintAddExtra
(
mpConfig
.
jshint
.
all
,
initConfig
.
jshint
,
'all'
);
jshintAddExtra
(
mpConfig
.
jshint
.
main
,
initConfig
.
jshint
.
main
.
files
,
mpConfig
.
base
);
jshintAddExtra
(
mpConfig
.
jshint
.
model
,
initConfig
.
jshint
.
model
.
files
,
mpConfig
.
base
);
jshintAddExtra
(
mpConfig
.
jshint
.
view
,
initConfig
.
jshint
.
view
.
files
,
mpConfig
.
base
);
checkList
.
push
(
'jshint'
);
}
jscheckerAddExtra
(
mpConfig
[
name
].
all
,
initConfig
[
name
],
'all'
);
jscheckerAddExtra
(
mpConfig
[
name
].
main
,
initConfig
[
name
].
main
.
files
,
mpConfig
.
base
);
jscheckerAddExtra
(
mpConfig
[
name
].
model
,
initConfig
[
name
].
model
.
files
,
mpConfig
.
base
);
jscheckerAddExtra
(
mpConfig
[
name
].
view
,
initConfig
[
name
].
view
.
files
,
mpConfig
.
base
);
checkList
.
push
(
name
);
}
createJschecker
(
'jshint'
,
{
globals
:
{
define
:
false
,
require
:
false
,
},
},
null
,
null
);
if
(
mpConfig
.
csslint
)
{
initConfig
.
csslint
=
{
};
...
...
Please
register
or
sign in
to post a comment