eslint-config-clock
v1.2.0
Published
Clock JavaScript Coding Standard
Readme
Clock JavaScript Coding Standard
This is an extension of standard minus the comma first and multi vars. We'd have loved to stick with standard 100% but we have a lot of active legacy projects and with this minor change we were able to easily nick all the good stuff that standard have defined.
Usage
In your project folder:
npm install --save-dev [email protected]
npm install --save-dev eslint-config-clock
npm install --save-dev [email protected]
npm install --save-dev [email protected]Then create a .eslintrc in the project root.
{
"extends": "clock"
}Any override to the standards should go in this file.
Legacy Updates
The following can be used to fix some inconsistencies from our jshint/jscs
projects.
First you need to install replace
npm install -g replace
replace 'function\(' 'function (' . -r --include='*.js' --exclude='node_modules,vendor'
replace 'function\s([^\s]+?)\(' 'function $1 (' . -r --include='*.js' --exclude='node_modules,vendor'
replace '\(\s([^ ])' '($1' . -r --include='*.js' --exclude='node_modules,vendor'
replace '([^\s\n])\s+\)' '$1)' . -r --include='*.js' --exclude='node_modules,vendor'
replace 'jshint camelcase: false' 'eslint camelcase: [2, {properties: "never"}]' . -r --include='*.js' --exclude='node_modules,vendor'
replace '=\s\s+(.)' '= $1' . -m false -r --include='*.js' --exclude='node_modules,vendor'
/function\s([^\s]+?)(/ to function $1 (
') )'' to '))'
'function(' to 'function (''
'( ' to '('
',function' to ', function'
/* jshint maxcomplexity: (\d+) / to / eslint complexity: [ 2, $1 ] */
