Moving to ESLint for code formatting rules.

This commit is contained in:
Richard Davey 2016-08-23 09:26:42 +01:00
parent cbef6d6648
commit 5fa3e568f5
3 changed files with 27 additions and 1 deletions

24
.eslintrc.json Normal file
View file

@ -0,0 +1,24 @@
{
"env": {
"browser": true
},
"extends": "eslint:recommended",
"rules": {
"indent": [
"error",
4
],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"single"
],
"semi": [
"error",
"always"
]
}
}

View file

@ -18,7 +18,7 @@
"boss" : true, // Tolerate assignments inside if, for & while. Usually conditions & loops are for comparison, not assignments. "boss" : true, // Tolerate assignments inside if, for & while. Usually conditions & loops are for comparison, not assignments.
"camelcase" : true, // Force all variable names to use either camelCase style or UPPER_CASE with underscores. "camelcase" : true, // Force all variable names to use either camelCase style or UPPER_CASE with underscores.
"curly" : true, // Require {} for every new block or scope. "curly" : true, // Require {} for every new block or scope.
"eqeqeq" : false, // Require triple equals i.e. `===`. "eqeqeq" : true, // Require triple equals i.e. `===`.
"eqnull" : true, // Tolerate use of `== null`. "eqnull" : true, // Tolerate use of `== null`.
"evil" : false, // Tolerate use of `eval`. "evil" : false, // Tolerate use of `eval`.
"expr" : false, // Tolerate `ExpressionStatement` as Programs. "expr" : false, // Tolerate `ExpressionStatement` as Programs.

View file

@ -30,6 +30,7 @@
"web audio" "web audio"
], ],
"devDependencies": { "devDependencies": {
"eslint": "^3.3.1",
"grunt": "^0.4.5", "grunt": "^0.4.5",
"grunt-contrib-clean": "^0.5.0", "grunt-contrib-clean": "^0.5.0",
"grunt-contrib-concat": "^0.4.0", "grunt-contrib-concat": "^0.4.0",
@ -37,6 +38,7 @@
"grunt-contrib-copy": "^0.5.0", "grunt-contrib-copy": "^0.5.0",
"grunt-contrib-jshint": "^0.9.2", "grunt-contrib-jshint": "^0.9.2",
"grunt-contrib-uglify": "^0.4.0", "grunt-contrib-uglify": "^0.4.0",
"grunt-eslint": "^19.0.0",
"grunt-git": "^0.3.3", "grunt-git": "^0.3.3",
"grunt-jsdoc": "~0.6.2-beta", "grunt-jsdoc": "~0.6.2-beta",
"grunt-notify": "^0.3.0", "grunt-notify": "^0.3.0",