Skip to content

Commit 9b49e21

Browse files
committed
Fix linting
1 parent 2ff770c commit 9b49e21

File tree

9 files changed

+11
-0
lines changed

9 files changed

+11
-0
lines changed

src/helpers/plugin.test.js

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const validateContext = (context) => {
99
}
1010

1111
const addInstancesData = (info, originalInfo) =>
12+
// eslint-disable-next-line fp/no-mutating-methods
1213
Object.defineProperty(
1314
info,
1415
'instancesData',

src/options/clone.js

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ const deepCloneObject = (object) => {
3232
for (const key of Reflect.ownKeys(object)) {
3333
const descriptor = Object.getOwnPropertyDescriptor(object, key)
3434
const childCopy = deepClone(descriptor.value)
35+
// eslint-disable-next-line fp/no-mutating-methods
3536
Object.defineProperty(copy, key, { ...descriptor, value: childCopy })
3637
}
3738

src/options/clone.test.js

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ each(ErrorSubclasses, ({ title }, ErrorClass) => {
1414

1515
test(`Options can be non-enumerable | ${title}`, (t) => {
1616
const { options } = new ErrorClass('test', {
17+
// eslint-disable-next-line fp/no-mutating-methods
1718
prop: Object.defineProperty({}, 'one', {
1819
value: true,
1920
enumerable: false,

src/plugins/info/main.js

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export const getPluginInfo = ({
4646
// `instancesData` is internal, undocumented and non-enumerable.
4747
// It is only needed in very specific plugins like `modern-errors-serialize`
4848
const setInstancesData = (info) => {
49+
// eslint-disable-next-line fp/no-mutating-methods
4950
Object.defineProperty(info, 'instancesData', {
5051
value: instancesData,
5152
enumerable: false,

src/plugins/info/main.test.js

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ each(
2323
test(`plugin.properties|instanceMethods|staticMethods cannot modify ErrorClasses | ${title}`, (t) => {
2424
const { ErrorClasses: ErrorClassesInfo } = getInfo(ErrorClass)
2525
const { length } = ErrorClassesInfo
26+
// eslint-disable-next-line fp/no-mutating-methods
2627
ErrorClassesInfo.push(true)
2728
t.is(ErrorClass.getProp().ErrorClasses.length, length)
2829
})

src/plugins/properties/assign.test.js

+2
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ each(ErrorSubclasses, ({ title }, ErrorClass) => {
4747

4848
test(`plugin.properties() non-enumerable properties can be assigned | ${title}`, (t) => {
4949
const cause = new ErrorClass('test')
50+
// eslint-disable-next-line fp/no-mutating-methods
5051
Object.defineProperty(cause, 'nonEnumProp', {
5152
value: true,
5253
enumerable: false,
@@ -86,6 +87,7 @@ each(ErrorSubclasses, ({ title }, ErrorClass) => {
8687

8788
test(`plugin.properties() keeps descriptors | ${title}`, (t) => {
8889
const cause = new ErrorClass('test')
90+
// eslint-disable-next-line fp/no-mutating-methods
8991
Object.defineProperty(cause, 'prop', {
9092
value: false,
9193
enumerable: false,

src/subclass/check.test.js

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { ErrorClasses } from '../helpers/main.test.js'
55

66
class NullClass {}
77

8+
// eslint-disable-next-line fp/no-mutating-methods
89
Object.setPrototypeOf(NullClass, null)
910

1011
each(
@@ -69,6 +70,7 @@ each(ErrorClasses, ['', null], ({ title }, ErrorClass, invalidPrototype) => {
6970
const custom = () => {}
7071
// eslint-disable-next-line fp/no-mutation
7172
custom.prototype = invalidPrototype
73+
// eslint-disable-next-line fp/no-mutating-methods
7274
Object.setPrototypeOf(custom, ErrorClass)
7375
t.throws(ErrorClass.subclass.bind(undefined, 'TestError', { custom }))
7476
})

src/subclass/normalize.test.js

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ each(ErrorClasses, ({ title }, ErrorClass) => {
3838
test(`ErrorClass.normalize() normalizes known errors | ${title}`, (t) => {
3939
const error = new ErrorClass('test')
4040
const { name } = error
41+
// eslint-disable-next-line fp/no-mutating-methods
4142
Object.defineProperty(error, 'name', {
4243
value: name,
4344
enumerable: true,

src/utils/descriptors.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Most error core properties are not enumerable
22
export const setNonEnumProp = (object, propName, value) => {
3+
// eslint-disable-next-line fp/no-mutating-methods
34
Object.defineProperty(object, propName, {
45
value,
56
enumerable: false,

0 commit comments

Comments
 (0)