Skip to content

Commit

Permalink
Merge pull request #173 from iambumblehead/lint-mjs-files
Browse files Browse the repository at this point in the history
lint-fix .mjs files
  • Loading branch information
iambumblehead authored Oct 5, 2022
2 parents 7fde5d8 + b744ecd commit 996a798
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
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

0 comments on commit 996a798

Please sign in to comment.