Merge branch 'unstable' into userconfig_disappearingmessage

pull/2971/head
William Grant 2 years ago
commit 46fc21ebbf

@ -1,4 +1,5 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
npx lint-staged
# Disabling this hook for now because the BuildLintCommand has issues. If you have an error in a file that eslint catches the commit fails silently instead of explaining the error (Will 04/09/2023)
# npx lint-staged

@ -1,29 +1,42 @@
const ignoredFiles = [
'package.json',
'yarn.lock',
'tsconfig.json',
'.lintstagedrc.js',
'.eslintrc.js',
];
const path = require('path');
const buildFormatCommand = filenames => {
const results = filenames
.map(f => path.relative(process.cwd(), f))
.filter(f => !ignoredFiles.includes(f));
return results.length ? `prettier --list-different --write ${results.join(' ')}` : '';
const { ESLint } = require('eslint');
const removeIgnoredFiles = async files => {
const eslint = new ESLint();
const isIgnored = await Promise.all(
files.map(file => {
return eslint.isPathIgnored(file);
})
);
const filteredFiles = files.filter((_, i) => !isIgnored[i]);
return filteredFiles.join(' ');
};
const buildFormatCommand = async files => {
const filesToLint = await removeIgnoredFiles(files);
if (!filesToLint || !filesToLint.length) {
return '';
}
const results = filesToLint.map(f => path.relative(process.cwd(), f));
return results.length
? `prettier --ignore-unknown --list-different --write ${results.join(' ')}`
: '';
};
const buildLintCommand = filenames => {
const results = filenames
.map(f => path.relative(process.cwd(), f))
.filter(f => !ignoredFiles.includes(f));
const buildLintCommand = async files => {
const filesToLint = await removeIgnoredFiles(files);
if (!filesToLint || !filesToLint.length) {
return '';
}
const results = filesToLint.map(f => path.relative(process.cwd(), f));
return results.length ? `eslint --cache ${results.join(' ')}` : '';
};
module.exports = {
'*.{js,ts,tsx}': [buildFormatCommand, buildLintCommand],
'*.{css,js,json,scss,ts,tsx}': [buildFormatCommand, buildLintCommand],
};

@ -12,6 +12,10 @@ Session integrates directly with [Oxen Service Nodes](https://docs.oxen.io/about
Please search for any [existing issues](https://github.com/oxen-io/session-desktop/issues) that describe your bug in order to avoid duplicate submissions. <br><br>Submissions can be made by making a pull request to our development branch.If you don't know where to start contributing please read [Contributing.md](CONTRIBUTING.md) and refer to issues tagged with the [Good-first-issue](https://github.com/oxen-io/session-desktop/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) tag.
## Supported platforms
Session requires Windows 10 or later, macOS Catalina (10.15) or later, or a linux distribution with glibc 2.28 or later like Debian 10 or Ubuntu 20.04.
## Build instruction
Build instructions can be found in [Contributing.md](CONTRIBUTING.md).

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save