set trailing comma to none
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Gregory Assasie · committed by Gregory Assasie · parent 1f1cab5 · Browse files · 5 files·+18 added−18 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
5 files+18 added−18 removed
- tests:+17 added−17 removed
- other:+1 added−1 removed
Provenance
- Commit
347259d- Tree
1bb9040- Author
Gregory Assasie <gregjarvez@gmail.com>- Committer
Gregory Assasie <gregjarvez@gmail.com>- Parent
1f1cab5
5 files changed+18 added−18 removed
modified:__tests__/base.js+9 added-9 removed
147 unmodified lines148 anArray: [3, 2, {c: 3}, 1],149 aProp: "hi",150 messy: {151 nested: {152- yummie: true,152+ yummie: true153 },154- coffee: false,155- },154+ coffee: false155+ }156 })157 expect(nextState.messy.nested).toBe(baseState.anObject.nested)158 })159 11 unmodified lines171 anArray: [3, 2, {c: 3}, 1],172 aProp: "hello",173 messy: {174 nested: {175- yummie: true,175+ yummie: true176 },177- coffee: true,178- },177+ coffee: true178+ }179 })180 expect(nextState.messy.nested).toBe(baseState.anObject.nested)181 })182 52 unmodified lines235 anArray: [3, 2, {c: 3}, 1],236 aProp: "hi",237 anObject: {238 nested: {239- yummie: true,239+ yummie: true240 },241- coffee: false,242- },241+ coffee: false242+ }243 }244 }245 })modified:__tests__/frozen.js+1 added-1 removed
2 unmodified lines34567789101138 unmodified lines2 unmodified lines
describe("auto freeze", () => { const baseState = { object: {a: 1}, array: [1, 2], array: [1, 2] }
it("should freeze objects after modifications", () => { expect(Object.isFrozen(baseState.object)).toBe(false) // initially not frozen38 unmodified linesmodified:__tests__/performance.js+4 added-4 removed
13 unmodified lines141516171818192021229 unmodified lines3233343536363738394014 unmodified lines5556575859596061616263646527 unmodified lines13 unmodified lines for (let i = 0; i < MAX; i++) { baseState.push({ todo: "todo_" + i, done: false, someThingCompletelyIrrelevant: [1, 2, 3, 4, 5, 6, 7, 8, 9, 0], someThingCompletelyIrrelevant: [1, 2, 3, 4, 5, 6, 7, 8, 9, 0] }) }
// Produce the frozen bazeState9 unmodified lines // generate immutalbeJS base state const todoRecord = Record({ todo: "", done: false, someThingCompletelyIrrelevant: [], someThingCompletelyIrrelevant: [] }) immutableJsBaseState = List(baseState.map(todo => todoRecord(todo)))
// The benchmarks14 unmodified lines test("handcrafted reducer", () => { const nextState = [ ...baseState.slice(0, MAX * MODIFY_FACTOR).map(todo => ({ ...todo, done: true, done: true })), ...baseState.slice(MAX * MODIFY_FACTOR), ...baseState.slice(MAX * MODIFY_FACTOR) ] })
test("immutableJS", () => {27 unmodified linesmodified:__tests__/readme.js+3 added-3 removed
4 unmodified lines567899101112131413141516171818 unmodified lines4 unmodified lines it("works", () => { const baseState = [ { todo: "Learn typescript", done: true, done: true }, { todo: "Try immer", done: false, }, done: false } ]
const nextState = immer(baseState, draft => { draft.push({todo: "Tweet about it"})18 unmodified linesmodified:.prettierrc+1 added-1 removed
4 unmodified lines5 "requirePragma": false,6 "semi": false,7 "singleQuote": false,8 "tabWidth": 4,9- "trailingComma": "all",9+ "trailingComma": "none",10 "useTabs": false,11 "overrides": [12 {13 "files": "*.json",6 unmodified lines