Skip to content

Commit

Permalink
fix: resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
koko57 committed Dec 11, 2023
2 parents d6c78ee + cc43294 commit 3f2cb41
Show file tree
Hide file tree
Showing 41 changed files with 1,535 additions and 1,422 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
module.exports = {
extends: 'expensify',
extends: ['expensify', 'prettier'],
rules: {
// Overwriting this for now because web-e will conflict with this
'react/jsx-filename-extension': [1, {extensions: ['.js']}],
'rulesdir/no-multiple-onyx-in-file': 'off',
},
env: {
jest: true,
Expand Down
9 changes: 9 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
dist/**/*.js
package.json
package-lock.json
*.html
*.yml
*.yaml
*.css
*.scss
*.md
9 changes: 9 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
tabWidth: 4,
singleQuote: true,
trailingComma: 'all',
bracketSpacing: false,
arrowParens: 'always',
printWidth: 190,
singleAttributePerLine: true,
};
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = (api) => {
const isWeb = api.caller(caller => caller && caller.target === 'web');
const isWeb = api.caller((caller) => caller && caller.target === 'web');
if (isWeb) {
return {
// Default browser list is a reasonable preset covering a wide list of non-dead browsers
Expand Down
1 change: 0 additions & 1 deletion jestSetup.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ jest.useRealTimers();

const unstable_batchedUpdates_jest = require('react-test-renderer').unstable_batchedUpdates;
require('./lib/batch.native').default = unstable_batchedUpdates_jest;

6 changes: 1 addition & 5 deletions lib/Logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,4 @@ function logInfo(message) {
logger({message: `[Onyx] ${message}`, level: 'info'});
}

export {
registerLogger,
logInfo,
logAlert,
};
export {registerLogger, logInfo, logAlert};
25 changes: 11 additions & 14 deletions lib/MDTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,16 @@ class MDTable extends AsciTable {
toString() {
// Ignore modifying the first |---| for titled tables
let idx = this.getTitle() ? -2 : -1;
const ascii = super.toString()
.replace(/-\|/g, () => {
/* we replace "----|" with "---:|" to align the data to the right in MD */
idx++;
const ascii = super.toString().replace(/-\|/g, () => {
/* we replace "----|" with "---:|" to align the data to the right in MD */
idx++;

if (idx < 0 || this.leftAlignedCols.includes(idx)) {
return '-|';
}
if (idx < 0 || this.leftAlignedCols.includes(idx)) {
return '-|';
}

return ':|';
});
return ':|';
});

// strip the top and the bottom row (----) to make an MD table
const md = ascii.split('\n').slice(1, -1).join('\n');
Expand All @@ -52,16 +51,14 @@ class MDTable extends AsciTable {
* @param {Array} [options.rows] The table can be initialized with row. Rows can also be added by `addRow`
* @returns {MDTable}
*/
MDTable.factory = ({
title, heading, leftAlignedCols = [], rows = [],
}) => {
MDTable.factory = ({title, heading, leftAlignedCols = [], rows = []}) => {
const table = new MDTable({title, heading, rows});
table.leftAlignedCols = leftAlignedCols;

/* By default we want everything aligned to the right as most values are numbers
* we just override the columns that are not right aligned */
* we just override the columns that are not right aligned */
heading.forEach((name, idx) => table.setAlign(idx, AsciTable.RIGHT));
leftAlignedCols.forEach(idx => table.setAlign(idx, AsciTable.LEFT));
leftAlignedCols.forEach((idx) => table.setAlign(idx, AsciTable.LEFT));

return table;
};
Expand Down
5 changes: 1 addition & 4 deletions lib/Onyx.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,7 @@ declare function clear(keysToPreserve?: OnyxKey[]): Promise<void>;
* @param collectionKey e.g. `ONYXKEYS.COLLECTION.REPORT`
* @param collection Object collection keyed by individual collection member keys and values
*/
declare function mergeCollection<TKey extends CollectionKeyBase, TMap>(
collectionKey: TKey,
collection: Collection<TKey, TMap, NullishDeep<KeyValueMapping[TKey]>>,
): Promise<void>;
declare function mergeCollection<TKey extends CollectionKeyBase, TMap>(collectionKey: TKey, collection: Collection<TKey, TMap, NullishDeep<KeyValueMapping[TKey]>>): Promise<void>;

/**
* Insert API responses and lifecycle data into Onyx
Expand Down
Loading

0 comments on commit 3f2cb41

Please sign in to comment.