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

lint-fix .mjs files #173

Merged
merged 2 commits into from
Oct 5, 2022
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# changelog

* 2.0.5 _Oct.05.2022_
* [add support for esmock.strictest,](https://github.com/iambumblehead/esmock/pull/172) a more-strict variant of esmock, per @gmahomarf
* [use more-descriptive internal-variable "treeId",](https://github.com/iambumblehead/esmock/pull/170) rather than "esmockKey"
* [include .mjs files in eslint filter](https://github.com/iambumblehead/esmock/pull/173) and lint-fix existing .mjs files
* 2.0.4 _Sep.28.2022_
* [huge simplifications to typescript types file,](https://github.com/iambumblehead/esmock/pull/164) much smaller, credit @jsejcksn
* [added ts linting](https://github.com/iambumblehead/esmock/pull/166)
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "esmock",
"type": "module",
"version": "2.0.4",
"version": "2.0.5",
"license": "ISC",
"readmeFilename": "README.md",
"description": "provides native ESM import mocking for unit tests",
Expand Down Expand Up @@ -73,8 +73,8 @@
"test": "npm run test:all",
"test-ci": "npm run test:install && npm run test:all-ci",
"test-cover": "npm run test:install && c8 npm run test:all",
"lint": "eslint .",
"lint-fix": "eslint --fix .",
"lint": "eslint --ext=.js,.mjs .",
"lint-fix": "eslint --ext=.js,.mjs --fix .",
"mini:pkg": "npm pkg delete scripts devDependencies",
"prepublishOnly": "npm run lint && npm run test-ci && npm run mini:pkg"
}
Expand Down
2 changes: 1 addition & 1 deletion tests/local/exampleMJS.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export default function thedefaultfunction () {
return 'not-mocked';
return 'not-mocked'
}
14 changes: 7 additions & 7 deletions tests/local/usesInlineImport.mjs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@

async function writeJSConfigFile (config, filePath) {
const eslint = (await import('eslint'));
const eslint = (await import('eslint'))

return new eslint.ESLint({
baseConfig : config,
fix : true,
useEslintrc : false,
baseConfig: config,
fix: true,
useEslintrc: false,
filePath
});
};
})
}

export default writeJSConfigFile;
export default writeJSConfigFile