diff --git a/src/index.ts b/src/index.ts index a6254b5f..808234e9 100644 --- a/src/index.ts +++ b/src/index.ts @@ -19,6 +19,10 @@ const equivalents = [ 'space-before-function-paren' ] as const +function clone (value: T): T { + return JSON.parse(JSON.stringify(value)) +} + function fromEntries (iterable: Array<[string, T]>): { [key: string]: T } { return [...iterable].reduce<{ [key: string]: T }>((obj, [key, val]) => { obj[key] = val @@ -44,7 +48,7 @@ export = { 'no-use-before-define': 'off', // @typescript-eslint versions of Standard.js rules: - ...fromEntries(equivalents.map((name) => [`@typescript-eslint/${name}`, standardRules[name]])), + ...fromEntries(equivalents.map((name) => [`@typescript-eslint/${name}`, clone(standardRules[name])])), '@typescript-eslint/no-use-before-define': ['error', { functions: false, classes: false,