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

chore: convert to esm #2261

Merged
merged 11 commits into from
Feb 18, 2024
Merged
Show file tree
Hide file tree
Changes from 6 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
2 changes: 1 addition & 1 deletion .eslintrc.js → .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const { readGitignoreFiles } = require('eslint-gitignore');
module.exports = defineConfig({
ignorePatterns: [
...readGitignoreFiles(),
'.eslintrc.js', // Skip self linting
'.eslintrc.cjs', // Skip self linting
],
root: true,
env: {
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ jobs:
env:
CYPRESS_INSTALL_BINARY: 0

- name: Build types
run: pnpm run build:types

- name: Check scripts
run: pnpm run ts-check

Expand Down
5 changes: 3 additions & 2 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// @ts-check

/**
* @type {import('prettier').Options}
* @type {import('prettier').Config}
*/
module.exports = {
export default {
plugins: ['prettier-plugin-organize-imports'],
singleQuote: true,
trailingComma: 'es5',
Expand All @@ -20,6 +20,7 @@ module.exports = {
{
files: '*.md',
options: {
// @ts-expect-error: known property
organizeImportsSkipDestructiveCodeActions: true,
},
},
Expand Down
15 changes: 9 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@
],
"bugs": "https://github.com/faker-js/faker/issues",
"license": "MIT",
"main": "dist/index.js",
"module": "dist/index.mjs",
"type": "module",
"main": "dist/index.cjs",
"module": "dist/index.js",
"types": "index.d.ts",
"typesVersions": {
">=4.0": {
Expand All @@ -41,13 +42,15 @@
"exports": {
".": {
"types": "./dist/types/index.d.ts",
"require": "./dist/index.js",
"import": "./dist/index.mjs"
"import": "./dist/index.js",
"require": "./dist/index.cjs",
"default": "./dist/index.js"
},
"./locale/*": {
"types": "./dist/types/locale/*.d.ts",
"require": "./dist/locale/*.js",
"import": "./dist/locale/*.mjs"
"import": "./dist/locale/*.js",
"require": "./dist/locale/*.cjs",
"default": "./dist/locale/*.js"
},
"./package.json": "./package.json"
},
Expand Down
Loading
Loading