Skip to content

Commit

Permalink
update dependencies and adjusts to eslint config (#231)
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima authored Oct 15, 2023
1 parent e5f563a commit 2eb49fd
Show file tree
Hide file tree
Showing 23 changed files with 1,029 additions and 224 deletions.
22 changes: 0 additions & 22 deletions .eslintrc

This file was deleted.

30 changes: 30 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"extends": [
"xo",
"prettier",
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"parser": "@typescript-eslint/parser",
"env": {
"node": true
},
"plugins": ["prettier", "@typescript-eslint"],
"ignorePatterns": ["dist", "node_modules"],
"rules": {
"@typescript-eslint/no-explicit-any": "off",
"default-param-last": "off",
"padding-line-between-statements": "off",
"max-params": "off",
"no-eq-null": "off",
"eqeqeq": [
"error",
"always",
{
"null": "ignore"
}
],
"prettier/prettier": "error"
},
"root": true
}
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"plugins": ["prettier-plugin-packagejson"],
"endOfLine": "auto",
"singleQuote": true,
"printWidth": 120
Expand Down
10 changes: 6 additions & 4 deletions __tests__/commit.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ describe('#commit()', () => {
it('call filters and trigger callback on error', async () => {
let called = 0;

// eslint-disable-next-line require-yield
const filter = Duplex.from(async function* (generator: AsyncGenerator<MemFsEditorFile>) {
for await (const file of generator) {
// eslint-disable-next-line no-unreachable-loop, @typescript-eslint/no-unused-vars
for await (const _file of generator) {
called++;
throw new Error(`error ${called}`);
}
Expand All @@ -65,7 +67,7 @@ describe('#commit()', () => {
file.contents = Buffer.from('modified');
yield file;
}
})
}),
);

expect(called).toBe(100);
Expand All @@ -83,7 +85,7 @@ describe('#commit()', () => {
file.contents = Buffer.from('modified');
yield file;
}
})
}),
);
expect(called).toBe(10);
expect(fs.read(path.join(output, 'file-1.txt'))).toBe('modified');
Expand Down Expand Up @@ -160,7 +162,7 @@ describe('#commit()', () => {
expect(file.path).not.toEqual(path.resolve('copy-to-delete'));
yield file;
}
})
}),
);
});
});
Expand Down
2 changes: 1 addition & 1 deletion __tests__/copy-async.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe('#copyAsync()', () => {
const filepath = getFixture('file-a.txt');
const newPath = '/new/path/file.txt';
expect(fs.copyAsync(filepath, newPath, { append: true, processFile: () => '' })).rejects.toEqual(
new Error('Current mem-fs is not compatible with append')
new Error('Current mem-fs is not compatible with append'),
);
});
});
Expand Down
4 changes: 2 additions & 2 deletions __tests__/copy-tpl-async.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe('#copyTpl()', () => {
{ name: 'mustache' },
{
delimiter: '?',
}
},
);
expect(fs.read(newPath)).toBe('mustache' + os.EOL);
});
Expand Down Expand Up @@ -94,7 +94,7 @@ describe('#copyTpl()', () => {
{},
{
context: { a },
}
},
);
expect(fs.read(newPath)).toBe('new content new content' + os.EOL);
});
Expand Down
4 changes: 2 additions & 2 deletions __tests__/copy-tpl.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('#copyTpl()', () => {
{ name: 'mustache' },
{
delimiter: '?',
}
},
);
expect(fs.read(newPath)).toBe('mustache' + os.EOL);
});
Expand Down Expand Up @@ -96,7 +96,7 @@ describe('#copyTpl()', () => {
{},
{
context: { a },
}
},
);
expect(fs.read(newPath)).toBe('new content new content' + os.EOL);
});
Expand Down
2 changes: 1 addition & 1 deletion __tests__/read-json.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe('#readJSON()', () => {
expect(
fs.readJSON.bind(fs, getFixture('file-tpl.txt'), {
foo: 'bar',
})
}),
).toThrow();
});

Expand Down
Loading

0 comments on commit 2eb49fd

Please sign in to comment.