[FIX] owl: add prettier to devDependencies

also, run prettier on codebase

closes #498
This commit is contained in:
Géry Debongnie
2019-11-26 22:35:11 +01:00
committed by aab-odoo
parent a3f2d07b40
commit 8fb35ed969
7 changed files with 57 additions and 12 deletions
+1
View File
@@ -39,6 +39,7 @@
"jest-environment-jsdom": "^24.7.1",
"live-server": "^1.2.1",
"npm-run-all": "^4.1.5",
"prettier": "^1.19.1",
"rollup": "^1.6.0",
"rollup-plugin-typescript2": "^0.20.1",
"sass": "^1.16.1",
+1 -1
View File
@@ -101,7 +101,7 @@ function isVnode(vnode: any): vnode is VNode {
type KeyToIndexMap = { [key: string]: number };
type ArraysOf<T> = { [K in keyof T]: (T[K])[] };
type ArraysOf<T> = { [K in keyof T]: T[K][] };
type ModuleHooks = ArraysOf<Module>;
+29 -5
View File
@@ -1362,7 +1362,13 @@ describe("composition", () => {
class SubWidget extends Widget {}
class Parent extends Widget {
static components = { SubWidget };
state = useState({ blips: [{ a: "a", id: 1 }, { b: "b", id: 2 }, { c: "c", id: 4 }] });
state = useState({
blips: [
{ a: "a", id: 1 },
{ b: "b", id: 2 },
{ c: "c", id: 4 }
]
});
}
const parent = new Parent();
await parent.mount(fixture);
@@ -1465,7 +1471,11 @@ describe("composition", () => {
</t>
</div>`;
state = useState({
records: [{ id: 1, val: 1 }, { id: 2, val: 2 }, { id: 3, val: 3 }]
records: [
{ id: 1, val: 1 },
{ id: 2, val: 2 },
{ id: 3, val: 3 }
]
});
static components = { ChildWidget };
}
@@ -3731,7 +3741,12 @@ describe("t-slot directive", () => {
class Link extends Widget {}
class App extends Widget {
state = useState({ users: [{ id: 1, name: "Aaron" }, { id: 2, name: "David" }] });
state = useState({
users: [
{ id: 1, name: "Aaron" },
{ id: 2, name: "David" }
]
});
static components = { Link };
}
@@ -3770,7 +3785,12 @@ describe("t-slot directive", () => {
class Link extends Widget {}
class App extends Widget {
state = useState({ users: [{ id: 1, name: "Aaron" }, { id: 2, name: "David" }] });
state = useState({
users: [
{ id: 1, name: "Aaron" },
{ id: 2, name: "David" }
]
});
static components = { Link };
}
@@ -4406,7 +4426,11 @@ describe("t-model directive", () => {
</t>
</div>
`;
state = useState([{ f: false, id: 1 }, { f: false, id: 2 }, { f: false, id: 3 }]);
state = useState([
{ f: false, id: 1 },
{ f: false, id: 2 },
{ f: false, id: 3 }
]);
}
const comp = new SomeComponent();
await comp.mount(fixture);
+4 -1
View File
@@ -1225,7 +1225,10 @@ describe("t-on", () => {
);
const steps: string[] = [];
const owner = {
projects: [{ id: 1, name: "Project 1" }, { id: 2, name: "Project 2" }],
projects: [
{ id: 1, name: "Project 1" },
{ id: 2, name: "Project 2" }
],
onEdit(projectId, ev) {
expect(ev.defaultPrevented).toBe(true);
+4 -1
View File
@@ -27,7 +27,10 @@ describe("tokenizer", () => {
{ type: "VALUE", value: "2" },
{ type: "RIGHT_BRACE", value: "}" }
]);
expect(tokenize("a,")).toEqual([{ type: "SYMBOL", value: "a" }, { type: "COMMA", value: "," }]);
expect(tokenize("a,")).toEqual([
{ type: "SYMBOL", value: "a" },
{ type: "COMMA", value: "," }
]);
expect(tokenize("][")).toEqual([
{ type: "RIGHT_BRACKET", value: "]" },
{ type: "LEFT_BRACKET", value: "[" }
+8 -2
View File
@@ -35,7 +35,10 @@ describe("Link component", () => {
static components = { Link: Link };
}
const routes = [{ name: "about", path: "/about" }, { name: "users", path: "/users" }];
const routes = [
{ name: "about", path: "/about" },
{ name: "users", path: "/users" }
];
router = new TestRouter(env, routes, { mode: "history" });
router.navigate({ to: "users" });
@@ -66,7 +69,10 @@ describe("Link component", () => {
static components = { Link: Link };
}
const routes = [{ name: "about", path: "/about" }, { name: "users", path: "/users" }];
const routes = [
{ name: "about", path: "/about" },
{ name: "users", path: "/users" }
];
router = new TestRouter(env, routes, { mode: "history" });
router.navigate({ to: "users" });
+10 -2
View File
@@ -293,7 +293,12 @@ describe("connecting a component to store", () => {
});
test("useStore can use props", async () => {
const state = { todos: [{ id: 1, text: "jupiler" }, { id: 2, text: "chimay" }] };
const state = {
todos: [
{ id: 1, text: "jupiler" },
{ id: 2, text: "chimay" }
]
};
const store = new Store({ state, actions: {} });
class TodoItem extends Component<any, any> {
@@ -360,7 +365,10 @@ describe("connecting a component to store", () => {
test("can call useGetters to receive store getters", async () => {
const state = {
importantID: 1,
todos: [{ id: 1, text: "jupiler" }, { id: 2, text: "bertinchamps" }]
todos: [
{ id: 1, text: "jupiler" },
{ id: 2, text: "bertinchamps" }
]
};
const getters = {
importantTodoText({ state }) {