Skip to content

Commit

Permalink
ESM import without es path [feat]
Browse files Browse the repository at this point in the history
  • Loading branch information
overlookmotel committed Apr 4, 2020
1 parent 074a457 commit e07e130
Show file tree
Hide file tree
Showing 7 changed files with 236 additions and 27 deletions.
15 changes: 14 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,26 @@ module.exports = {
'@overlookmotel/eslint-config-node'
],
overrides: [
// Entry points reference files in dist folder which only exist after build
{
// Entry point references files in dist folder which only exist after build
files: ['./index.js'],
rules: {
'node/no-missing-require': 'off',
'import/no-unresolved': 'off'
}
},
{
files: ['./es/index.js'],
parserOptions: {
sourceType: 'module'
},
rules: {
'node/no-unsupported-features/es-syntax': ['error', {ignores: ['modules']}],
// Entry point references files in dist folder which only exist after build
'node/no-missing-import': 'off',
'node/no-unpublished-import': 'off',
'import/no-unresolved': 'off'
}
}
]
};
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const { isString } = require('is-it-type');
or:

```js
import { isString } from 'is-it-type/es';
import { isString } from 'is-it-type';
```

### Use a method
Expand Down
23 changes: 0 additions & 23 deletions es/.eslintrc.js

This file was deleted.

3 changes: 3 additions & 0 deletions es/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"type": "module"
}
206 changes: 206 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e07e130

Please sign in to comment.