Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit c037d87

Browse files
committed
Switched from JSHint\JSLint to ESLint
to lint Brackets core code.
1 parent 40ad8e9 commit c037d87

6 files changed

Lines changed: 85 additions & 87 deletions

File tree

.brackets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"defaultExtension": "js",
1111
"language": {
1212
"javascript": {
13-
"linting.prefer": ["JSLint", "JSHint"],
13+
"linting.prefer": ["ESLint"],
1414
"linting.usePreferredOnly": true
1515
}
1616
},

.eslintrc

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
{
2+
"env": {
3+
"node": true
4+
},
5+
"rules": {
6+
"no-bitwise": 0,
7+
"curly": 2,
8+
"eqeqeq": 2,
9+
"guard-for-in": 0,
10+
"wrap-iife": [2, "outside"],
11+
"no-use-before-define": 0,
12+
"new-cap": [0, {
13+
"capIsNewExceptions": [
14+
"$.Deferred",
15+
"$.Event",
16+
"CodeMirror.Pos",
17+
"Immutable.Map",
18+
"Immutable.List",
19+
"JSLINT"
20+
]}],
21+
"no-caller": 2,
22+
"no-empty": 0,
23+
"no-new": 2,
24+
"no-invalid-regexp": 2,
25+
"no-control-regex": 2,
26+
"no-regex-spaces": 2,
27+
"no-undef": 2,
28+
"strict": 0,
29+
"no-unused-vars": [0, {"vars": "all", "args": "none"}],
30+
"semi": 2,
31+
32+
"no-iterator": 2,
33+
"no-loop-func": 2,
34+
"no-multi-str": 2,
35+
"no-fallthrough": 2,
36+
"no-proto": 2,
37+
"no-script-url": 2,
38+
"no-shadow": 0,
39+
"no-shadow-restricted-names": 2,
40+
"no-new-func": 2,
41+
"no-new-wrappers": 2,
42+
"no-new-require": 2,
43+
"new-parens": 2,
44+
"no-new-object": 2,
45+
"no-invalid-this": 0,
46+
indent: [0, 4],
47+
48+
"valid-jsdoc": 0,
49+
"valid-typeof": 2,
50+
51+
"no-trailing-spaces": 0,
52+
"eol-last": 0
53+
},
54+
"globals": {
55+
"brackets": false,
56+
57+
"window": false,
58+
// Resemble a browser environment.
59+
"alert": false,
60+
"document": false,
61+
"localStorage": false,
62+
"navigator": false,
63+
"setTimeout": false,
64+
65+
"require": false,
66+
"define": false,
67+
"$": false,
68+
"PathUtils": false,
69+
"Mustache": false
70+
}
71+
}

.jshintrc

Lines changed: 0 additions & 70 deletions
This file was deleted.

Gruntfile.js

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ module.exports = function (grunt) {
2525
'use strict';
2626

2727
// load dependencies
28-
require('load-grunt-tasks')(grunt, {pattern: ['grunt-contrib-*', 'grunt-targethtml', 'grunt-usemin', 'grunt-cleanempty']});
28+
require('load-grunt-tasks')(grunt, {pattern: ['grunt-contrib-*', 'grunt-targethtml', 'grunt-usemin', 'grunt-cleanempty', 'grunt-eslint']});
2929
grunt.loadTasks('tasks');
3030

3131
// Project configuration.
@@ -241,19 +241,19 @@ module.exports = function (grunt) {
241241
watch: {
242242
all : {
243243
files: ['**/*', '!**/node_modules/**'],
244-
tasks: ['jshint']
244+
tasks: ['eslint']
245245
},
246246
grunt : {
247247
files: ['<%= meta.grunt %>', 'tasks/**/*'],
248-
tasks: ['jshint:grunt']
248+
tasks: ['eslint:grunt']
249249
},
250250
src : {
251251
files: ['<%= meta.src %>', 'src/**/*'],
252-
tasks: ['jshint:src']
252+
tasks: ['eslint:src']
253253
},
254254
test : {
255255
files: ['<%= meta.test %>', 'test/**/*'],
256-
tasks: ['jshint:test']
256+
tasks: ['eslint:test']
257257
}
258258
},
259259
/* FIXME (jasonsanjose): how to handle extension tests */
@@ -299,13 +299,12 @@ module.exports = function (grunt) {
299299
'jasmine_node': {
300300
projectRoot: 'src/extensibility/node/spec/'
301301
},
302-
jshint: {
302+
eslint: {
303303
grunt: '<%= meta.grunt %>',
304304
src: '<%= meta.src %>',
305305
test: '<%= meta.test %>',
306-
/* use strict options to mimic JSLINT until we migrate to JSHINT in Brackets */
307306
options: {
308-
jshintrc: '.jshintrc'
307+
configFile: '.eslintrc'
309308
}
310309
},
311310
shell: {
@@ -320,16 +319,16 @@ module.exports = function (grunt) {
320319
grunt.registerTask('install', ['write-config', 'less']);
321320

322321
// task: test
323-
grunt.registerTask('test', ['jshint', 'jasmine', 'nls-check']);
324-
// grunt.registerTask('test', ['jshint', 'jasmine', 'jasmine_node']);
322+
grunt.registerTask('test', ['eslint', 'jasmine', 'nls-check']);
323+
// grunt.registerTask('test', ['eslint', 'jasmine', 'jasmine_node', 'nls-check']);
325324

326325
// task: set-release
327326
// Update version number in package.json and rewrite src/config.json
328327
grunt.registerTask('set-release', ['update-release-number', 'write-config']);
329328

330329
// task: build
331330
grunt.registerTask('build', [
332-
'jshint:src',
331+
'eslint:src',
333332
'jasmine',
334333
'clean',
335334
'less',

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"grunt-cli": "0.1.9",
2020
"phantomjs": "1.9.18",
2121
"grunt-lib-phantomjs": "0.3.0",
22-
"grunt-contrib-jshint": "0.6.0",
22+
"grunt-eslint": "17.1.0",
2323
"grunt-contrib-watch": "0.4.3",
2424
"grunt-contrib-jasmine": "0.4.2",
2525
"grunt-template-jasmine-requirejs": "0.1.0",
@@ -36,7 +36,6 @@
3636
"load-grunt-tasks": "0.2.0",
3737
"q": "0.9.2",
3838
"semver": "^4.1.0",
39-
"jshint": "2.1.4",
4039
"xmldoc": "^0.1.2",
4140
"grunt-cleanempty": "1.0.3"
4241
},

src/config.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"extension_url": "https://s3.amazonaws.com/extend.brackets/{0}/{0}-{1}.zip",
2121
"linting.enabled_by_default": true,
2222
"build_timestamp": "",
23-
"healthDataServerURL" : "https://healthdev.brackets.io/healthDataLog"
23+
"healthDataServerURL": "https://healthdev.brackets.io/healthDataLog"
2424
},
2525
"name": "Brackets",
2626
"version": "1.6.0-0",
@@ -42,7 +42,7 @@
4242
"grunt-cli": "0.1.9",
4343
"phantomjs": "1.9.18",
4444
"grunt-lib-phantomjs": "0.3.0",
45-
"grunt-contrib-jshint": "0.6.0",
45+
"grunt-eslint": "17.1.0",
4646
"grunt-contrib-watch": "0.4.3",
4747
"grunt-contrib-jasmine": "0.4.2",
4848
"grunt-template-jasmine-requirejs": "0.1.0",
@@ -59,7 +59,6 @@
5959
"load-grunt-tasks": "0.2.0",
6060
"q": "0.9.2",
6161
"semver": "^4.1.0",
62-
"jshint": "2.1.4",
6362
"xmldoc": "^0.1.2",
6463
"grunt-cleanempty": "1.0.3"
6564
},

0 commit comments

Comments
 (0)