Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update eslint disallow trailing whitespace #276

Merged
merged 2 commits into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"Set": true
},
"rules": {
"no-trailing-spaces": [2],
"no-unused-vars": [ "error", {
"vars": "all",
"args": "after-used",
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

* 2.6.1 _???.??.2023_
* [update README to work w/ eslint-plugin-markdown](https://github.com/iambumblehead/esmock/pull/275)
* [update eslint](https://github.com/iambumblehead/esmock/pull/276) disallow trailing whitespace
* 2.6.0 _Nov.07.2023_
* [typings: make MockFunction generic,](https://github.com/iambumblehead/esmock/pull/267) thanks @uwinkelvos
* 2.5.9 _Nov.01.2023_
Expand Down
2 changes: 1 addition & 1 deletion src/esmock.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,5 @@ export {
type MockFunction,
type MockMap,
type Options,
type Resolver
type Resolver
}
2 changes: 1 addition & 1 deletion src/esmockModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const isJSONExtnRe = /\.json$/i

// assigning the object to its own prototypal inheritor can error, eg
// 'Cannot assign to read only property \'F_OK\' of object \'#<Object>\''
//
//
// if not plain obj, assign enumerable vals only. core modules === plain obj
const esmockModuleMerge = (defLive, def) => isPlainObj(defLive)
? Object.assign({}, defLive, def)
Expand Down
2 changes: 1 addition & 1 deletion tests/local/pnp/enable.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ async function resolve (specifier, context, next) {
? '../tests/local/pnp/api.js'
: specifier, context)
}

module.register && (process.versions.pnp = '3') && module.register(`
data:text/javascript,
export ${encodeURIComponent(resolve)}`.slice(1))
2 changes: 1 addition & 1 deletion tests/tests-node/esmock.node.resolver-pnp.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ test.beforeEach(() => {
test('should work with pnp resolver', async ({ mock }) => {
if (!module.register)
return assert.ok('skip test')

pnpapi.resolveRequest = mock.fn(resolver)

const main = await esmock('../local/main.js', {
Expand Down
4 changes: 2 additions & 2 deletions tests/tests-node/esmock.node.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ test('should mock imported json', async () => {

if (/^(18|20)$/.test(process.versions.node.split('.')[0]))
return assert.ok(true)

assert.strictEqual(
Object.keys(importsJSON.JSONobj).sort().join(), 'example,test-example')
assert.strictEqual(importsJSON.JSONobj['test-example'], 'test-json-a')
Expand All @@ -576,7 +576,7 @@ test('should mock imported json (strict)', async () => {

if (/^(18|20)$/.test(process.versions.node.split('.')[0]))
return assert.ok(true)

assert.strictEqual(
Object.keys(importsJSON.JSONobj).sort().join(), 'test-example')
assert.strictEqual(importsJSON.JSONobj['test-example'], 'test-json-b')
Expand Down