This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const windowBy = <K, T>( | |
keyFn: (t: T) => K | |
): OperatorFunction<T, GroupedObservable<K, T>> => (source) => source.pipe( | |
publish((sharedSource) => { | |
const newWindow = sharedSource.pipe( | |
distinctUntilChanged((a, b) => keyFn(a) === keyFn(b)) | |
); | |
return sharedSource.pipe( | |
groupBy(keyFn, undefined, () => | |
newWindow.pipe( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const baseRule = require("./no-foreach"); | |
module.exports = { | |
meta: { | |
/* ... */ | |
}, | |
create(context) { | |
const contextForBaseRule = Object.create(context, { | |
options: { | |
value: [{ types: ["Array"] }], | |
writable: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TypeError: Error while loading rule 'no-array-foreach': Cannot assign | |
to read only property 'options' of object '#<Object>' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const baseRule = require("./no-foreach"); | |
module.exports = { | |
meta: { | |
/* ... */ | |
}, | |
create(context) { | |
const contextForBaseRule = Object.create(context); | |
contextForBaseRule.options = [{ types: ["Array"] }]; | |
return baseRule.create(contextForBaseRule); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TypeError: Error while loading rule 'no-array-foreach': 'get' on | |
proxy: property 'options' is a read-only and non-configurable data | |
property on the proxy target but the proxy did not return its actual | |
value (expected '[object Array]' but got '[object Array]') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const baseRule = require("./no-foreach"); | |
module.exports = { | |
meta: { | |
/* ... */ | |
}, | |
create(context) { | |
const contextForBaseRule = new Proxy(context, { | |
get(target, property, receiver) { | |
if (property === "options") { | |
return [{ types: ["Array"] }]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Error while loading rule 'no-array-foreach': You have used a rule | |
which requires parserServices to be generated. You must therefore | |
provide a value for the "parserOptions.project" property for | |
@typescript-eslint/parser. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const baseRule = require("./no-foreach"); | |
module.exports = { | |
meta: { | |
/* ... */ | |
}, | |
create(context) { | |
const contextForBaseRule = { | |
...context, | |
options: [{ types: ["Array"] }] | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TypeError: Error while loading rule 'no-array-foreach': Cannot assign | |
to read only property 'options' of object '#<Object>' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const baseRule = require("./no-foreach"); | |
module.exports = { | |
meta: { | |
/* ... */ | |
deprecated: true, | |
replacedBy: ["no-foreach"] | |
}, | |
create(context) { | |
context.options = [{ types: ["Array"] }]; | |
return baseRule.create(context); |
NewerOlder