Skip to content

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
coderaiser committed Jun 7, 2024
1 parent 70077fc commit 464a4ae
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 34 deletions.
10 changes: 0 additions & 10 deletions .eslintrc.json

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
node-version:
- 18.x
- 20.x
- 21.x
- 22.x
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
Expand All @@ -30,7 +30,7 @@ jobs:
run: redrun fix:lint
- name: Install Rust
run: rustup update
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
Expand Down
5 changes: 1 addition & 4 deletions .madrun.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import {
run,
cutEnv,
} from 'madrun';
import {run, cutEnv} from 'madrun';

const NODE_OPTIONS = `'--no-warnings --import ./lib/register.js'`;
const testEnv = {
Expand Down
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ coverage*
example

coverage
*.config.*
3 changes: 2 additions & 1 deletion .nycrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"exclude": [
"**/*.spec.js",
"**/fixture",
"**/*.*.js"
"**/*.*.js",
"**/*.config.*"
],
"branches": 100,
"lines": 100,
Expand Down
11 changes: 3 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export {readFile as readFile1} from 'fs/promises';
```js
/**/
export * from 'fs/promises';

// doesn't have syntax equivalent
```

Expand Down Expand Up @@ -170,10 +171,7 @@ You can test it with 📼[`Supertape`](https://github.com/coderaiser/supertape):

```js
import {createMockImport} from 'mock-import';
import {
test,
stub,
} from 'supertape';
import {test, stub} from 'supertape';

const {
mockImport,
Expand Down Expand Up @@ -202,10 +200,7 @@ Now let's trace it:
```js
import {createMockImport} from 'mock-import';
import {
test,
stub,
} from 'supertape';
import {test, stub} from 'supertape';

const {
mockImport,
Expand Down
13 changes: 13 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import {
matchToFlat,
createESLintConfig,
} from '@putout/eslint-flat';
import {safeAlign} from 'eslint-plugin-putout/config';

export const match = {
'**/{fresh,register.js}': {
'n/no-unsupported-features/node-builtins': 'off',
},
};

export default createESLintConfig([safeAlign, matchToFlat(match)]);
5 changes: 1 addition & 4 deletions lib/convert-imports/index.spec.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import {createMockImport} from '../mock-import.js';
import {readFile} from 'node:fs/promises';
import {
test,
stub,
} from 'supertape';
import {test, stub} from 'supertape';
import {convertImports} from './index.js';

const {url} = import.meta;
Expand Down
7 changes: 2 additions & 5 deletions lib/mock-import.spec.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import {readFile} from 'node:fs/promises';
import {
test,
stub,
} from 'supertape';
import {test, stub} from 'supertape';
import tryToCatch from 'try-to-catch';
import process from 'node:process';
import {
Expand Down Expand Up @@ -302,7 +299,7 @@ test('mock-import: mockImport: transformSource: traceImport: reImport: nested',

test('mock-import: reImport: native', async (t) => {
const path = await reImport('path');
const nativePath = await import('path');
const nativePath = await import('node:path');

t.equal(path, nativePath);
t.end();
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"license": "MIT",
"devDependencies": {
"@cloudcmd/stub": "^4.0.1",
"@putout/eslint-flat": "^2.0.0",
"@putout/test": "^10.0.0",
"c8": "^9.1.0",
"check-dts": "^0.8.0",
Expand Down

0 comments on commit 464a4ae

Please sign in to comment.