mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] owl: add prettier to devDependencies
also, run prettier on codebase closes #498
This commit is contained in:
@@ -39,6 +39,7 @@
|
|||||||
"jest-environment-jsdom": "^24.7.1",
|
"jest-environment-jsdom": "^24.7.1",
|
||||||
"live-server": "^1.2.1",
|
"live-server": "^1.2.1",
|
||||||
"npm-run-all": "^4.1.5",
|
"npm-run-all": "^4.1.5",
|
||||||
|
"prettier": "^1.19.1",
|
||||||
"rollup": "^1.6.0",
|
"rollup": "^1.6.0",
|
||||||
"rollup-plugin-typescript2": "^0.20.1",
|
"rollup-plugin-typescript2": "^0.20.1",
|
||||||
"sass": "^1.16.1",
|
"sass": "^1.16.1",
|
||||||
|
|||||||
+1
-1
@@ -101,7 +101,7 @@ function isVnode(vnode: any): vnode is VNode {
|
|||||||
|
|
||||||
type KeyToIndexMap = { [key: string]: number };
|
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>;
|
type ModuleHooks = ArraysOf<Module>;
|
||||||
|
|
||||||
|
|||||||
@@ -1362,7 +1362,13 @@ describe("composition", () => {
|
|||||||
class SubWidget extends Widget {}
|
class SubWidget extends Widget {}
|
||||||
class Parent extends Widget {
|
class Parent extends Widget {
|
||||||
static components = { SubWidget };
|
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();
|
const parent = new Parent();
|
||||||
await parent.mount(fixture);
|
await parent.mount(fixture);
|
||||||
@@ -1465,7 +1471,11 @@ describe("composition", () => {
|
|||||||
</t>
|
</t>
|
||||||
</div>`;
|
</div>`;
|
||||||
state = useState({
|
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 };
|
static components = { ChildWidget };
|
||||||
}
|
}
|
||||||
@@ -3731,7 +3741,12 @@ describe("t-slot directive", () => {
|
|||||||
class Link extends Widget {}
|
class Link extends Widget {}
|
||||||
|
|
||||||
class App 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 };
|
static components = { Link };
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3770,7 +3785,12 @@ describe("t-slot directive", () => {
|
|||||||
class Link extends Widget {}
|
class Link extends Widget {}
|
||||||
|
|
||||||
class App 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 };
|
static components = { Link };
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4406,7 +4426,11 @@ describe("t-model directive", () => {
|
|||||||
</t>
|
</t>
|
||||||
</div>
|
</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();
|
const comp = new SomeComponent();
|
||||||
await comp.mount(fixture);
|
await comp.mount(fixture);
|
||||||
|
|||||||
@@ -1225,7 +1225,10 @@ describe("t-on", () => {
|
|||||||
);
|
);
|
||||||
const steps: string[] = [];
|
const steps: string[] = [];
|
||||||
const owner = {
|
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) {
|
onEdit(projectId, ev) {
|
||||||
expect(ev.defaultPrevented).toBe(true);
|
expect(ev.defaultPrevented).toBe(true);
|
||||||
|
|||||||
@@ -27,7 +27,10 @@ describe("tokenizer", () => {
|
|||||||
{ type: "VALUE", value: "2" },
|
{ type: "VALUE", value: "2" },
|
||||||
{ type: "RIGHT_BRACE", value: "}" }
|
{ 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([
|
expect(tokenize("][")).toEqual([
|
||||||
{ type: "RIGHT_BRACKET", value: "]" },
|
{ type: "RIGHT_BRACKET", value: "]" },
|
||||||
{ type: "LEFT_BRACKET", value: "[" }
|
{ type: "LEFT_BRACKET", value: "[" }
|
||||||
|
|||||||
@@ -35,7 +35,10 @@ describe("Link component", () => {
|
|||||||
static components = { Link: Link };
|
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 = new TestRouter(env, routes, { mode: "history" });
|
||||||
router.navigate({ to: "users" });
|
router.navigate({ to: "users" });
|
||||||
@@ -66,7 +69,10 @@ describe("Link component", () => {
|
|||||||
static components = { Link: Link };
|
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 = new TestRouter(env, routes, { mode: "history" });
|
||||||
router.navigate({ to: "users" });
|
router.navigate({ to: "users" });
|
||||||
|
|||||||
@@ -293,7 +293,12 @@ describe("connecting a component to store", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("useStore can use props", async () => {
|
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: {} });
|
const store = new Store({ state, actions: {} });
|
||||||
|
|
||||||
class TodoItem extends Component<any, any> {
|
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 () => {
|
test("can call useGetters to receive store getters", async () => {
|
||||||
const state = {
|
const state = {
|
||||||
importantID: 1,
|
importantID: 1,
|
||||||
todos: [{ id: 1, text: "jupiler" }, { id: 2, text: "bertinchamps" }]
|
todos: [
|
||||||
|
{ id: 1, text: "jupiler" },
|
||||||
|
{ id: 2, text: "bertinchamps" }
|
||||||
|
]
|
||||||
};
|
};
|
||||||
const getters = {
|
const getters = {
|
||||||
importantTodoText({ state }) {
|
importantTodoText({ state }) {
|
||||||
|
|||||||
Reference in New Issue
Block a user