Skip to content
This repository was archived by the owner on Aug 7, 2023. It is now read-only.

Commit baf1aa8

Browse files
author
Ian VanSchooten
committed
Remove unneeded semicolons
1 parent 0229738 commit baf1aa8

File tree

6 files changed

+50
-49
lines changed

6 files changed

+50
-49
lines changed

lib/es5-helpers.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
'use strict';
1+
'use strict'
22

33
const ChildProcess = require('child_process')
44
const Path = require('path')
@@ -7,7 +7,7 @@ const FS = require('fs')
77
let prefixPath = null
88

99
function find(startDir, names) {
10-
let localNames;
10+
let localNames
1111
if (typeof names === 'string') {
1212
localNames = [names]
1313
} else {

lib/main.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,11 @@ export default {
8080
if (!textEditor || textEditor.isModified()) {
8181
// Ignore invalid or unsaved text editors
8282
atom.notifications.addError('Linter-ESLint: Please save before fixing')
83-
return;
83+
return
8484
}
8585

8686
if (this.worker === null) {
87-
return;
87+
return
8888
}
8989

9090
this.worker.request('FIX', {
@@ -135,7 +135,7 @@ export default {
135135
lint: textEditor => {
136136
const text = textEditor.getText()
137137
if (text.length === 0) {
138-
return Promise.resolve([]);
138+
return Promise.resolve([])
139139
}
140140
const filePath = textEditor.getPath()
141141
const fileDir = Path.dirname(filePath)
@@ -147,7 +147,7 @@ export default {
147147
type: 'Info',
148148
text: 'Worker initialization is delayed. Please try saving or typing to begin linting.',
149149
range: Helpers.rangeFromLineNumber(textEditor, 0)
150-
}]);
150+
}])
151151
}
152152

153153
return this.worker.request('JOB', {

lib/worker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Communication.on('JOB', function(job) {
4242
// Determine which eslint instance to use
4343
const eslintNewPath = findEslintDir(params)
4444
if (eslintNewPath !== eslintPath) {
45-
eslint = getEslintCli(eslintNewPath);
45+
eslint = getEslintCli(eslintNewPath)
4646
eslintPath = eslintNewPath
4747
}
4848

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@
4343
"rules": {
4444
"no-empty": 0,
4545
"no-console": 0,
46-
"no-new": 0
46+
"no-new": 0,
47+
"semi": [2, "never"]
4748
},
4849
"parser": "babel-eslint",
4950
"globals": {

spec/es5-helpers-spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
'use babel';
1+
'use babel'
22

33
import Path from 'path'
44
import OS from 'os'
@@ -7,7 +7,7 @@ import {
77
determineConfigFile,
88
findEslintDir,
99
getEslintCli
10-
} from '../lib/es5-helpers';
10+
} from '../lib/es5-helpers'
1111

1212
let fixtureDir
1313

@@ -134,7 +134,7 @@ describe('The es5 linter-eslint helper', () => {
134134
fileDir: dir,
135135
global: false,
136136
}
137-
const foundEslintDir = findEslintDir(params);
137+
const foundEslintDir = findEslintDir(params)
138138
expect(foundEslintDir).toEqual(expectedPath)
139139
})
140140
})
@@ -151,6 +151,6 @@ describe('The es5 linter-eslint helper', () => {
151151

152152
it('teardown', () => {
153153
// Clean up temporary directory
154-
rm('-r', fixtureDir);
154+
rm('-r', fixtureDir)
155155
})
156156
})

spec/linter-eslint-spec.js

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,77 @@
1-
'use babel';
1+
'use babel'
22

33
describe('The eslint provider for Linter', () => {
44
const {spawnWorker} = require('../lib/helpers')
55
const worker = spawnWorker()
6-
const lint = require('../lib/main').provideLinter.call(worker).lint;
6+
const lint = require('../lib/main').provideLinter.call(worker).lint
77

88
beforeEach(() => {
99
waitsForPromise(() => {
1010
return atom.packages.activatePackage('language-javascript').then(() =>
1111
atom.workspace.open(__dirname + '/fixtures/files/good.js')
1212
)
13-
});
14-
});
13+
})
14+
})
1515

1616
describe('checks bad.js and', () => {
17-
let editor = null;
17+
let editor = null
1818
beforeEach(() => {
1919
waitsForPromise(() => {
20-
atom.config.set('linter-eslint.disableEslintIgnore', true);
20+
atom.config.set('linter-eslint.disableEslintIgnore', true)
2121
return atom.workspace.open(__dirname + '/fixtures/files/bad.js').then(openEditor => {
22-
editor = openEditor;
23-
});
24-
});
25-
});
22+
editor = openEditor
23+
})
24+
})
25+
})
2626

2727
it('finds at least one message', () => {
2828
return lint(editor).then(messages => {
29-
expect(messages.length).toBeGreaterThan(0);
30-
});
31-
});
29+
expect(messages.length).toBeGreaterThan(0)
30+
})
31+
})
3232

3333
it('verifies that message', () => {
3434
return lint(editor).then(messages => {
35-
expect(messages[0].type).toBeDefined();
36-
expect(messages[0].type).toEqual('Error');
37-
expect(messages[0].html).not.toBeDefined();
38-
expect(messages[0].text).toBeDefined();
39-
expect(messages[0].text).toEqual('"foo" is not defined.');
40-
expect(messages[0].filePath).toBeDefined();
41-
expect(messages[0].filePath).toMatch(/.+spec[\\\/]fixtures[\\\/]files[\\\/]bad\.js$/);
42-
expect(messages[0].range).toBeDefined();
43-
expect(messages[0].range.length).toEqual(2);
44-
expect(messages[0].range).toEqual([[0, 0], [0, 9]]);
45-
});
46-
});
47-
});
35+
expect(messages[0].type).toBeDefined()
36+
expect(messages[0].type).toEqual('Error')
37+
expect(messages[0].html).not.toBeDefined()
38+
expect(messages[0].text).toBeDefined()
39+
expect(messages[0].text).toEqual('"foo" is not defined.')
40+
expect(messages[0].filePath).toBeDefined()
41+
expect(messages[0].filePath).toMatch(/.+spec[\\\/]fixtures[\\\/]files[\\\/]bad\.js$/)
42+
expect(messages[0].range).toBeDefined()
43+
expect(messages[0].range.length).toEqual(2)
44+
expect(messages[0].range).toEqual([[0, 0], [0, 9]])
45+
})
46+
})
47+
})
4848

4949
it('finds nothing wrong with an empty file', () => {
5050
waitsForPromise(() => {
5151
return atom.workspace.open(__dirname + '/fixtures/files/empty.js').then(editor => {
5252
return lint(editor).then(messages => {
53-
expect(messages.length).toEqual(0);
54-
});
55-
});
53+
expect(messages.length).toEqual(0)
54+
})
55+
})
5656
})
57-
});
57+
})
5858

5959
it('finds nothing wrong with a valid file', () => {
6060
waitsForPromise(() => {
6161
return atom.workspace.open(__dirname + '/fixtures/files/good.js').then(editor => {
6262
return lint(editor).then(messages => {
63-
expect(messages.length).toEqual(0);
64-
});
65-
});
63+
expect(messages.length).toEqual(0)
64+
})
65+
})
6666
})
67-
});
67+
})
6868

6969
describe('when resolving import paths using eslint-plugin-import', () => {
7070
it('correctly resolves imports from parent', () => {
7171
waitsForPromise(() => {
7272
return atom.workspace.open(`${__dirname}/fixtures/import-resolution/nested/importing.js`).then(editor => {
7373
return lint(editor).then(messages => {
74-
expect(messages.length).toEqual(0);
74+
expect(messages.length).toEqual(0)
7575
})
7676
})
7777
})
@@ -83,10 +83,10 @@ describe('The eslint provider for Linter', () => {
8383
waitsForPromise(() => {
8484
return atom.workspace.open(`${__dirname}/fixtures/eslintignore/ignored.js`).then(editor => {
8585
return lint(editor).then(messages => {
86-
expect(messages.length).toEqual(0);
86+
expect(messages.length).toEqual(0)
8787
})
8888
})
8989
})
9090
})
9191
})
92-
});
92+
})

0 commit comments

Comments
 (0)