Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ module.exports = {
'no-multi-assign': 'warn',
'no-lonely-if': 'warn',
'newline-per-chained-call': 'warn',
'new-cap': 'warn',
'new-cap': 'off',
'func-name-matching': 'error',
// 'consistent-this' : 'error',
'line-comment-position': [
Expand Down
79 changes: 79 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
const {
defineConfig,
globalIgnores,
} = require("eslint/config");

const tsParser = require("@typescript-eslint/parser");
const globals = require("globals");
const js = require("@eslint/js");

const {
FlatCompat,
} = require("@eslint/eslintrc");

const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});

module.exports = defineConfig([{
languageOptions: {
parser: tsParser,

globals: {
...globals.node,
},

ecmaVersion: 2018,
sourceType: "module",
parserOptions: {},
},

extends: compat.extends("eslint:recommended", "plugin:@typescript-eslint/eslint-recommended"),

rules: {
indent: ["error", "tab"],
"linebreak-style": ["error", "unix"],
quotes: ["error", "single"],
semi: ["error", "always"],
"no-unused-vars": "warn",

"no-shadow": ["error", {
builtinGlobals: true,
hoist: "all",
allow: [],
}],

"prefer-template": "warn",
"prefer-spread": "warn",
"no-useless-concat": "warn",
"prefer-rest-params": "warn",
"prefer-destructuring": "warn",
"no-useless-computed-key": "warn",
"no-useless-constructor": "warn",
"no-useless-rename": "warn",
"no-this-before-super": "warn",
"no-new-symbol": "warn",
"no-duplicate-imports": "warn",
"no-confusing-arrow": "warn",
"no-multi-assign": "warn",
"no-lonely-if": "warn",
"newline-per-chained-call": "warn",
"new-cap": "off",
"func-name-matching": "error",

"line-comment-position": ["warn", {
position: "above",
}],

yoda: "warn",
},
}, {
files: ["lib/**/*.js"],

"rules": {
"prefer-rest-params": 0,
"no-redeclare": 0,
},
}, globalIgnores([])]);
2 changes: 1 addition & 1 deletion lib/errors.js

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

2 changes: 1 addition & 1 deletion lib/fields.js

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

13 changes: 7 additions & 6 deletions lib/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ export declare const BaseConstructorPrototype: {
new (): unknown;
(): void;
};
export declare class BaseClass {
constructor(_target?: object | null);
export declare class BaseClass<T extends object, S extends T> {
constructor(_target: S extends T ? S : never);
}
interface ITypeDefinition<T> {
new (): T;
(): void;
}
export declare const SymbolInitialValue: symbol;
type StrictRuntime = {
<T extends object>(target: object): T;
};
export declare const Strict: StrictRuntime;
export declare const Strict: <P extends object>(_target?: P | null) => <T extends ITypeDefinition<T>, M extends P & InstanceType<T>, IR extends { [key in keyof M]: M[key]; }>(cstr: T) => IR;
export {};
Loading