Skip to content

Commit

Permalink
ci(SFINT-2577): Ensure Prettier run properly on UNIX. (#43)
Browse files Browse the repository at this point in the history
* ongoing

* renaming prettierrc

* Ensure path are contained and evaluated properly on UNIX

* Move config back to root for VSCode ext sake

* Prettify the files
  • Loading branch information
louis-bompart authored Oct 7, 2019
1 parent 73d9b8c commit 53c94d8
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 48 deletions.
18 changes: 9 additions & 9 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
*.svg
*.gif
bin/**/*
node_modules/**/*
.vscode/**/*
.gitignore
.prettierignore
.snyk
.travis.yml
*.svg
*.gif
bin/**/*
node_modules/**/*
.vscode/**/*
.gitignore
.prettierignore
.snyk
.travis.yml
LICENSE
16 changes: 16 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
printWidth: 150,
tabWidth: 4,
useTabs: false,
semi: true,
singleQuote: true,
endOfLine: 'lf',
overrides: [
{
files: '*.json',
options: {
singleQuote: false
}
}
]
};
16 changes: 0 additions & 16 deletions .prettierrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ deploy:
on:
tags: true
repo: coveo/search-ui-extensions
condition: "! $TRAVIS_TAG =~ .*beta.*"
condition: "! $TRAVIS_TAG =~ .*beta.*"
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"css": "node ./scripts/css.js",
"dev": "node ./scripts/dev.server.js",
"watchTest": "karma start ./config/karma.config.js",
"lint": "prettier --check **/*",
"lint-fix": "prettier --write **/* ",
"lint": "prettier --check \"./**/*\" --config \".prettierrc.js\" --ignore-path \".prettierignore\"",
"lint-fix": "prettier --write \"./**/*\" --config \".prettierrc.js\" --ignore-path \".prettierignore\"",
"clean": "rimraf bin",
"snyk-protect": "snyk protect",
"prepare": "npm run snyk-protect"
Expand Down
8 changes: 5 additions & 3 deletions src/components/UserActions/ClickedDocumentList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,11 @@ export class ClickedDocumentList extends Component {
`<div class="coveo-list-row">
<div class="coveo-row-icon">${duplicate}</div>
<a class="CoveoResultLink"/a>
</div>`, {
layout: 'list'
})
</div>`,
{
layout: 'list'
}
)
})
};

Expand Down
2 changes: 1 addition & 1 deletion src/components/UserActions/QueryList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const DEFAULT_TRANSFORMATION = () => (query: string) => {
const icon = document.createElement('div');
icon.classList.add('coveo-row-icon');
icon.innerHTML = search;

const link = document.createElement('a');
link.classList.add('coveo-link');
link.innerHTML = query;
Expand Down
3 changes: 1 addition & 2 deletions src/components/UserActions/UserActions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ $search-ui-dropdown-header-color: #1d4f76;
list-style-type: none;

li {

.coveo-list-row {
display: flex;

Expand All @@ -96,7 +95,7 @@ $search-ui-dropdown-header-color: #1d4f76;
.coveo-row-icon {
position: relative;
width: $icon-container-size;

& > {
svg {
position: absolute;
Expand Down
8 changes: 4 additions & 4 deletions tests/components/UserActions/ClickedDocumentList.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,10 @@ describe('ClickedDocumentList', () => {
return delay(() => {
const list = mock.env.element.querySelector<HTMLOListElement>('.coveo-list');

for(let i=0; i<4; i++){
for (let i = 0; i < 4; i++) {
const icon = list.children.item(i).querySelector<HTMLElement>('svg');
expect(icon).toBeDefined;
};
}
});
});

Expand Down Expand Up @@ -238,7 +238,7 @@ describe('ClickedDocumentList', () => {
let getActionStub: SinonStub<[HTMLElement, ClickedDocumentList], void>;
const mock = Mock.advancedComponentSetup<ClickedDocumentList>(
ClickedDocumentList,
new Mock.AdvancedComponentSetupOptions(null, {userId: null}, env => {
new Mock.AdvancedComponentSetupOptions(null, { userId: null }, env => {
getActionStub = fakeUserProfileModel(env.root, sandbox).getActions;
return env;
})
Expand All @@ -253,7 +253,7 @@ describe('ClickedDocumentList', () => {
let getActionStub: SinonStub<[HTMLElement, ClickedDocumentList], void>;
const mock = Mock.advancedComponentSetup<ClickedDocumentList>(
ClickedDocumentList,
new Mock.AdvancedComponentSetupOptions(null, {userId: ''}, env => {
new Mock.AdvancedComponentSetupOptions(null, { userId: '' }, env => {
getActionStub = fakeUserProfileModel(env.root, sandbox).getActions;
return env;
})
Expand Down
14 changes: 7 additions & 7 deletions tests/components/UserActions/QueryList.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,12 @@ describe('QueryList', () => {
return delay(() => {
const list = mock.env.element.querySelector<HTMLOListElement>('.coveo-list');

for(let i=0; i<4; i++){
for (let i = 0; i < 4; i++) {
const icon = list.children.item(i).querySelector<HTMLElement>('svg');
expect(icon).toBeDefined;
};
})
})
}
});
});

it('should show all queries when expanded', () => {
const mock = Mock.advancedComponentSetup<QueryList>(
Expand Down Expand Up @@ -297,7 +297,7 @@ describe('QueryList', () => {
let getActionStub: SinonStub<[HTMLElement, QueryList], void>;
const mock = Mock.advancedComponentSetup<QueryList>(
QueryList,
new Mock.AdvancedComponentSetupOptions(null, {userId: null}, env => {
new Mock.AdvancedComponentSetupOptions(null, { userId: null }, env => {
getActionStub = fakeUserProfileModel(env.root, sandbox).getActions;
return env;
})
Expand All @@ -307,12 +307,12 @@ describe('QueryList', () => {
expect(mock.cmp.disabled).toBe(true);
});
});

it('Should disable itself when the userId is empty string', () => {
let getActionStub: SinonStub<[HTMLElement, QueryList], void>;
const mock = Mock.advancedComponentSetup<QueryList>(
QueryList,
new Mock.AdvancedComponentSetupOptions(null, {userId: ''}, env => {
new Mock.AdvancedComponentSetupOptions(null, { userId: '' }, env => {
getActionStub = fakeUserProfileModel(env.root, sandbox).getActions;
return env;
})
Expand Down
6 changes: 3 additions & 3 deletions tests/components/UserActions/UserActivity.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ describe('UserActivity', () => {
let getActionStub: SinonStub<[HTMLElement, UserActivity], void>;
const mock = Mock.advancedComponentSetup<UserActivity>(
UserActivity,
new Mock.AdvancedComponentSetupOptions(null, {userId: null}, env => {
new Mock.AdvancedComponentSetupOptions(null, { userId: null }, env => {
getActionStub = fakeUserProfileModel(env.root, sandbox).getActions;
return env;
})
Expand All @@ -542,12 +542,12 @@ describe('UserActivity', () => {
expect(mock.cmp.disabled).toBe(true);
});
});

it('Should disable itself when the userId is empty string', () => {
let getActionStub: SinonStub<[HTMLElement, UserActivity], void>;
const mock = Mock.advancedComponentSetup<UserActivity>(
UserActivity,
new Mock.AdvancedComponentSetupOptions(null, {userId: ''}, env => {
new Mock.AdvancedComponentSetupOptions(null, { userId: '' }, env => {
getActionStub = fakeUserProfileModel(env.root, sandbox).getActions;
return env;
})
Expand Down

0 comments on commit 53c94d8

Please # to comment.