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

Commit

Permalink
Merge pull request #11693 from ficristo/eslint
Browse files Browse the repository at this point in the history
Eslint
  • Loading branch information
abose committed Dec 8, 2015
2 parents 44487b7 + c037d87 commit 79f3e2c
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 87 deletions.
2 changes: 1 addition & 1 deletion .brackets.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"defaultExtension": "js",
"language": {
"javascript": {
"linting.prefer": ["JSLint", "JSHint"],
"linting.prefer": ["ESLint"],
"linting.usePreferredOnly": true
}
},
Expand Down
71 changes: 71 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"env": {
"node": true
},
"rules": {
"no-bitwise": 0,
"curly": 2,
"eqeqeq": 2,
"guard-for-in": 0,
"wrap-iife": [2, "outside"],
"no-use-before-define": 0,
"new-cap": [0, {
"capIsNewExceptions": [
"$.Deferred",
"$.Event",
"CodeMirror.Pos",
"Immutable.Map",
"Immutable.List",
"JSLINT"
]}],
"no-caller": 2,
"no-empty": 0,
"no-new": 2,
"no-invalid-regexp": 2,
"no-control-regex": 2,
"no-regex-spaces": 2,
"no-undef": 2,
"strict": 0,
"no-unused-vars": [0, {"vars": "all", "args": "none"}],
"semi": 2,

"no-iterator": 2,
"no-loop-func": 2,
"no-multi-str": 2,
"no-fallthrough": 2,
"no-proto": 2,
"no-script-url": 2,
"no-shadow": 0,
"no-shadow-restricted-names": 2,
"no-new-func": 2,
"no-new-wrappers": 2,
"no-new-require": 2,
"new-parens": 2,
"no-new-object": 2,
"no-invalid-this": 0,
indent: [0, 4],

"valid-jsdoc": 0,
"valid-typeof": 2,

"no-trailing-spaces": 0,
"eol-last": 0
},
"globals": {
"brackets": false,

"window": false,
// Resemble a browser environment.
"alert": false,
"document": false,
"localStorage": false,
"navigator": false,
"setTimeout": false,

"require": false,
"define": false,
"$": false,
"PathUtils": false,
"Mustache": false
}
}
70 changes: 0 additions & 70 deletions .jshintrc

This file was deleted.

21 changes: 10 additions & 11 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module.exports = function (grunt) {
'use strict';

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

// Project configuration.
Expand Down Expand Up @@ -241,19 +241,19 @@ module.exports = function (grunt) {
watch: {
all : {
files: ['**/*', '!**/node_modules/**'],
tasks: ['jshint']
tasks: ['eslint']
},
grunt : {
files: ['<%= meta.grunt %>', 'tasks/**/*'],
tasks: ['jshint:grunt']
tasks: ['eslint:grunt']
},
src : {
files: ['<%= meta.src %>', 'src/**/*'],
tasks: ['jshint:src']
tasks: ['eslint:src']
},
test : {
files: ['<%= meta.test %>', 'test/**/*'],
tasks: ['jshint:test']
tasks: ['eslint:test']
}
},
/* FIXME (jasonsanjose): how to handle extension tests */
Expand Down Expand Up @@ -299,13 +299,12 @@ module.exports = function (grunt) {
'jasmine_node': {
projectRoot: 'src/extensibility/node/spec/'
},
jshint: {
eslint: {
grunt: '<%= meta.grunt %>',
src: '<%= meta.src %>',
test: '<%= meta.test %>',
/* use strict options to mimic JSLINT until we migrate to JSHINT in Brackets */
options: {
jshintrc: '.jshintrc'
configFile: '.eslintrc'
}
},
shell: {
Expand All @@ -320,16 +319,16 @@ module.exports = function (grunt) {
grunt.registerTask('install', ['write-config', 'less']);

// task: test
grunt.registerTask('test', ['jshint', 'jasmine', 'nls-check']);
// grunt.registerTask('test', ['jshint', 'jasmine', 'jasmine_node']);
grunt.registerTask('test', ['eslint', 'jasmine', 'nls-check']);
// grunt.registerTask('test', ['eslint', 'jasmine', 'jasmine_node', 'nls-check']);

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

// task: build
grunt.registerTask('build', [
'jshint:src',
'eslint:src',
'jasmine',
'clean',
'less',
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"grunt-cli": "0.1.9",
"phantomjs": "1.9.18",
"grunt-lib-phantomjs": "0.3.0",
"grunt-contrib-jshint": "0.6.0",
"grunt-eslint": "17.1.0",
"grunt-contrib-watch": "0.4.3",
"grunt-contrib-jasmine": "0.4.2",
"grunt-template-jasmine-requirejs": "0.1.0",
Expand All @@ -36,7 +36,6 @@
"load-grunt-tasks": "0.2.0",
"q": "0.9.2",
"semver": "^4.1.0",
"jshint": "2.1.4",
"xmldoc": "^0.1.2",
"grunt-cleanempty": "1.0.3"
},
Expand Down
5 changes: 2 additions & 3 deletions src/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"extension_url": "https://s3.amazonaws.com/extend.brackets/{0}/{0}-{1}.zip",
"linting.enabled_by_default": true,
"build_timestamp": "",
"healthDataServerURL" : "https://healthdev.brackets.io/healthDataLog"
"healthDataServerURL": "https://healthdev.brackets.io/healthDataLog"
},
"name": "Brackets",
"version": "1.6.0-0",
Expand All @@ -42,7 +42,7 @@
"grunt-cli": "0.1.9",
"phantomjs": "1.9.18",
"grunt-lib-phantomjs": "0.3.0",
"grunt-contrib-jshint": "0.6.0",
"grunt-eslint": "17.1.0",
"grunt-contrib-watch": "0.4.3",
"grunt-contrib-jasmine": "0.4.2",
"grunt-template-jasmine-requirejs": "0.1.0",
Expand All @@ -59,7 +59,6 @@
"load-grunt-tasks": "0.2.0",
"q": "0.9.2",
"semver": "^4.1.0",
"jshint": "2.1.4",
"xmldoc": "^0.1.2",
"grunt-cleanempty": "1.0.3"
},
Expand Down

0 comments on commit 79f3e2c

Please sign in to comment.