@voxpelli/lintlovin v4.0.0
Lintlovin
Lintlovin sets up your project for automatic linting, whitespace checking, and runs mocha tests (if you have any).
On install (npm install @voxpelli/lintlovin --save-dev) it will set up a Grunt file, .editorconfig, .jshintrc, and a git hook that runs test before you push. The gotcha here is that it will run tests on what is in you working directory, and not on the actual contents of the branch.
To run tests continually while editing run grunt watch in your project. To run tests manually just run npm test.
ESLint options
By default uses semistandard, but this is easily overrideable through the .eslintrc in ones own project.
Available Grunt tasks
The npm-based commands don't need grunt-cli, but the grunt commands do.
- default – the default task, the one invoked when running just
grunt, will if no additional tasks are added just run thetesttask. - test – lints all files to the defined ESLint and EditorConfig coding style guidelines and, unless
noMochahas been set totrue, runs all tests in atest/-folder if such a one exist, with the exclusion of any tests in atest/integration/folder. Can be invoked through eithergrunt testornpm test. - test-all – like
test, but also runs the tests in thetest/integration/folder. Can be invoked through eithergrunt test-allornpm run test-all. - watch – watches for file changes and runs
teston any relevant change. Can be invoked throughgrunt watch.
lintlovin.initConfig(grunt, config)
To be run from the parent project's Gruntfile.js. Initializes the grunt object sent in with a basic task setup. Also allows additional task setups to be sent in through config and for altering the basic setup in some ways through options.
Options
- integrationWatch – makes the
watchtask also run tests intest/integration/, which can be unfeasible in big projects, but nice in smaller ones. Defaults tofalse. - alwaysIntegration – makes the
testtask also run tests intest/integration/, which can be unfeasible in big projects, but nice in smaller ones. Defaults tofalse. - jsFiles – an array of additional files to watch and lint. By default
.js-files in top folder or below thebin/,cli/,lib/ortest/folders will be watched and linted. (Also any non-js file intest/will be watched and will thus retrigger a test when changed) - spaceFiles – an array of additional files to just watch and whitespace lint.
- dependencyFiles – an array of additional files to just check for dependencies.
- watchFiles – an array of additional files to just watch.
- enableCoverageEvent – enables the grunt-mocha-istanbul coverage event on tests
- extraDefaultTasks – an array of additional tasks to add to the
defaulttask alias - extraTestTasks – an array of additional tasks to add to the
testtask alias - extraTestAllTasks – an array of additional tasks to add to the
test-alltask alias - extraWatchTasks – an object of additional watch task definitions
- noIntegration – whether there are integration tests in
test/integration/or not. Defaults totrueiftest/integration/exists. - noMocha – disables the Mocha tests. Mocha tests are otherwise run if a
test/-folder is found in the parent project. - noTiming – disables the time-grunt performance output
- noDependencyCheck – disables the dependency-check plugin
- ignoreUnusedDependencies – ignores the specified modules when looking for unused modules
9 years ago