Skip to content

Commit

Permalink
feat(config): determined extension based on project dialect
Browse files Browse the repository at this point in the history
  • Loading branch information
travi committed Apr 2, 2024
1 parent ed46928 commit 357def2
Show file tree
Hide file tree
Showing 17 changed files with 170 additions and 116 deletions.
8 changes: 8 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,11 @@ extends:
- '@form8ion'
- '@form8ion/cucumber'
- '@form8ion/mocha'

overrides:
- files:
- vitest.config.js
- templates/config.js
rules:
import/no-unresolved: off
no-console: off
25 changes: 24 additions & 1 deletion .remarkrc.json
Original file line number Diff line number Diff line change
@@ -1 +1,24 @@
{"settings":{"listItemIndent":1,"emphasis":"_","strong":"_","bullet":"*","incrementListMarker":false},"plugins":["@form8ion/remark-lint-preset",["remark-toc",{"tight":true}],["remark-usage",{"heading":"example"}]]}
{
"settings": {
"listItemIndent": "one",
"emphasis": "_",
"strong": "_",
"bullet": "*",
"incrementListMarker": false
},
"plugins": [
"@form8ion/remark-lint-preset",
[
"remark-toc",
{
"tight": true
}
],
[
"remark-usage",
{
"heading": "example"
}
]
]
}
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,15 @@ $ npm install @form8ion/vitest --save-prod
#### Import

```javascript
import {dialects} from '@form8ion/javascript-core';
import {scaffold} from '@form8ion/vitest';
```

#### Execute

```javascript
(async () => {
await scaffold({projectRoot: process.cwd()});
await scaffold({projectRoot: process.cwd(), dialect: dialects.ESM});
})();
```

Expand Down
5 changes: 3 additions & 2 deletions example.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
// #### Import
// remark-usage-ignore-next
import stubbedFs from 'mock-fs';
import {dialects} from '@form8ion/javascript-core';
import {scaffold} from './lib/index.mjs';

// remark-usage-ignore-next
stubbedFs({templates: {'canary-test.js': '', 'config.ts': ''}});
stubbedFs({templates: {'canary-test.js': '', 'config.js': ''}});

// #### Execute

(async () => {
await scaffold({projectRoot: process.cwd()});
await scaffold({projectRoot: process.cwd(), dialect: dialects.ESM});
})();
Loading

0 comments on commit 357def2

Please sign in to comment.