-
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
1,080 additions
and
1,883 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
export default class ESLintError extends WebpackError { | ||
export default class ESLintError { | ||
/** | ||
* @param {string=} messages | ||
*/ | ||
constructor(messages?: string | undefined); | ||
name: string; | ||
stack: string; | ||
} | ||
import { WebpackError } from 'webpack'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
declare const _exports: typeof import('.').default; | ||
declare const _exports: typeof plugin.default; | ||
export = _exports; | ||
import plugin = require('.'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import pack from './utils/pack'; | ||
|
||
describe('eslint lint', () => { | ||
const mockLintFiles = jest.fn().mockReturnValue([]); | ||
|
||
beforeAll(() => { | ||
jest.mock('eslint', () => { | ||
return { | ||
ESLint: function ESLint() { | ||
this.lintFiles = mockLintFiles; | ||
}, | ||
}; | ||
}); | ||
}); | ||
|
||
beforeEach(() => { | ||
mockLintFiles.mockClear(); | ||
}); | ||
|
||
it('should lint one file', (done) => { | ||
const compiler = pack('lint-one', { threads: false }); | ||
|
||
compiler.run((err) => { | ||
const files = [expect.stringMatching('lint-one-entry.js')]; | ||
expect(mockLintFiles).toHaveBeenCalledWith(files); | ||
expect(err).toBeNull(); | ||
done(); | ||
}); | ||
}); | ||
|
||
it('should lint two files', (done) => { | ||
const compiler = pack('lint-two', { threads: false }); | ||
|
||
compiler.run((err) => { | ||
const files = [ | ||
expect.stringMatching('lint-two-entry.js'), | ||
expect.stringMatching('lint.js'), | ||
]; | ||
expect(mockLintFiles).toHaveBeenCalledWith(files); | ||
expect(err).toBeNull(); | ||
done(); | ||
}); | ||
}); | ||
|
||
it('should lint more files', (done) => { | ||
const compiler = pack('lint-more', { threads: false }); | ||
|
||
compiler.run((err) => { | ||
const files = [ | ||
expect.stringMatching('lint-more-entry.js'), | ||
expect.stringMatching('lint-more.js'), | ||
expect.stringMatching('lint.js'), | ||
]; | ||
expect(mockLintFiles).toHaveBeenCalledWith(files); | ||
expect(err).toBeNull(); | ||
done(); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
require('./lint-more') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
require('./lint') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
require('./lint') | ||
require('./lint.js?foo=bar') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
function test() { | ||
return "value" | ||
} | ||
|
||
test() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters