Skip to content

Commit

Permalink
docs: use named import for utilities
Browse files Browse the repository at this point in the history
  • Loading branch information
Yash-Singh1 committed Jan 2, 2024
1 parent e6b67cd commit 0f0a4f6
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ jobs:
run: pnpm run build

- name: Publish Package
run: npm publish --access public
run: pnpm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
tests/
docs/
lib/
.github/
.husky/
.prettierrc.json
Expand Down
2 changes: 1 addition & 1 deletion docs/utils/createValidator.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ to ESLint's configuration.
Import the utility:

```js
const createValidator = require('eslint-plugin-userscripts/lib/utils/createValidator.js');
const { createValidator } = require('eslint-plugin-userscripts/dist/utils/createValidator');
```

## API
Expand Down
2 changes: 1 addition & 1 deletion docs/utils/parser.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ information on the metadata in the `SourceCode`.
## Usage

```js
const parse = require('eslint-plugin-userscripts/lib/utils/parse.js');
const { parse } = require('eslint-plugin-userscripts/dist/utils/parse');
```

`parse` is a function taking one argument, the `SourceCode`.
Expand Down
22 changes: 0 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,6 @@
],
"author": "Yash Singh",
"main": "./dist/index.js",
"exports": {
".": {
"import": "./dist/index.js",
"require": "./dist/index.js"
},
"./package.json": {
"import": "./package.json",
"require": "./package.json"
},
"./lib/rules": {
"import": "./dist/rules/index.js",
"require": "./dist/rules/index.js"
},
"./lib/utils/createValidator.js": {
"import": "./dist/utils/createValidator.js",
"require": "./dist/utils/createValidator.js"
},
"./lib/utils/parse.js": {
"import": "./dist/utils/parse.js",
"require": "./dist/utils/parse.js"
}
},
"scripts": {
"test": "nyc --reporter=lcov --reporter=text mocha --recursive --file $(find tests -type f -name \"*.ts\") -r esbuild-runner/register",
"build": "tsup",
Expand Down
3 changes: 2 additions & 1 deletion tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ export default defineConfig({
minify: false,
platform: 'node',
outDir: 'dist',
bundle: false
bundle: false,
dts: true,
});

0 comments on commit 0f0a4f6

Please sign in to comment.