Skip to content

Commit

Permalink
change default value of module-type from commonjs to esm
Browse files Browse the repository at this point in the history
  • Loading branch information
davidchambers committed Dec 9, 2023
1 parent d4bb5da commit b54bec4
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"root": true,
"extends": ["./node_modules/sanctuary-style/eslint-es6.json"],
"env": {"node": true}
"parserOptions": {"sourceType": "module"}
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Many variables have default values and are therefore optional.
| `comment-prefix` | `.` | The character which follows `//` to signify documentation to transcribe. |
| `opening-delimiter` | `` ```javascript `` | The opening delimiter of doctest blocks in the source files. |
| `closing-delimiter` | `` ``` `` | The closing delimiter of doctest blocks in the source files. |
| `module-type` | `commonjs` | The module system doctest should use (`amd`, `commonjs`, or `esm`). |
| `module-type` | `esm` | The module system doctest should use (`amd`, `commonjs`, or `esm`). |
| `version-tag-prefix` | `v` | The prefix of annotated version tags (`version-tag-prefix =` for no prefix). |

### Custom scripts
Expand Down
2 changes: 1 addition & 1 deletion functions
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ get() {
printf '```javascript' ;;
closing-delimiter) # shellcheck disable=SC2016
printf '```' ;;
module-type) printf 'commonjs' ;;
module-type) printf 'esm' ;;
version-tag-prefix) printf 'v' ;;
*)
echo "'$1' not defined in $config" >&2
Expand Down
6 changes: 1 addition & 5 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

//# identity :: a -> a
//.
//. Returns its argument.
Expand All @@ -8,6 +6,4 @@
//. > identity ([1, 2, 3])
//. [1, 2, 3]
//. ```
const identity = x => x;

module.exports = identity;
export const identity = x => x;
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"type": "git",
"url": "git://github.com/sanctuary-js/sanctuary-scripts.git"
},
"type": "module",
"files": [
"/bin/",
"/LICENSE",
Expand Down
6 changes: 2 additions & 4 deletions test/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
'use strict';
import assert from 'node:assert';

const assert = require ('node:assert');

const identity = require ('..');
import {identity} from '../index.js';


test ('identity (42)', () => {
Expand Down

0 comments on commit b54bec4

Please sign in to comment.