Skip to content

Commit

Permalink
chore: migrate to flat configs
Browse files Browse the repository at this point in the history
  • Loading branch information
mscharley committed Oct 6, 2024
1 parent 1ddb6e4 commit 46823fa
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 17 deletions.
6 changes: 0 additions & 6 deletions .eslintignore

This file was deleted.

4 changes: 0 additions & 4 deletions .eslintrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
uses: mscharley/.github/.github/workflows/node-ci.yml@main
strategy:
matrix:
node-version: [16.x, 18.x, 20.x, 22.x, current]
node-version: [18.x, 20.x, 22.x, current]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
with:
node-version: ${{ matrix.node-version }}
Expand Down
16 changes: 16 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { configs } from "@mscharley/eslint-config";

export default [
...configs.recommended,
...configs.node,
{
ignores: [
'node_modules',
'dist',
'coverage',
'reports/mutation',
'eslint.config.js',
'generic-type-guard.*',
],
},
];
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
"prepack": "npm run clean && npm run build",
"test": "npm run lint && npm run mocha && git diff --name-only --exit-code",
"test-watch": "nodemon -e ts,json --exec npm run test",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
"lint-fix": "eslint . --fix --ext .js,.jsx,.ts,.tsx",
"lint-watch": "nodemon -e ts,json --exec eslint . --ext .js,.jsx,.ts,.tsx",
"lint": "eslint",
"lint-fix": "eslint",
"lint-watch": "nodemon -e ts,json --exec eslint",
"mocha": "c8 mocha 'src/**/*.spec.ts'",
"mocha-watch": "nodemon -e ts,json --exec npm run mocha 'src/**/*.spec.ts'",
"stryker": "stryker run",
Expand Down
6 changes: 3 additions & 3 deletions src/primitives.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ describe('Primitives', function (this: Mocha.Suite) {
});

it('narrowValue', () => {
// eslint-disable-next-line deprecation/deprecation
// eslint-disable-next-line @typescript-eslint/no-deprecated
const narrow = p.narrowValue<unknown, string, 'foo'>(p.isString, p.isSingletonString('foo'));

expect(narrow('foo')).to.equal(true);
Expand Down Expand Up @@ -266,9 +266,9 @@ describe('Primitives', function (this: Mocha.Suite) {
});

it('never', () => {
// eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
const fn: Function = p.isNever;
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
// eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-call
expect(() => fn('Oops!')).to.throw('Unexpected value when expecting never: Oops!');
});
});
1 change: 1 addition & 0 deletions src/primitives.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,5 +301,6 @@ export const isUnknown = isAny;
* @public
*/
export const isNever = (n: never): never => {
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
throw Error(`Unexpected value when expecting never: ${n}`);
};

0 comments on commit 46823fa

Please sign in to comment.