Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into @radoslawkrzemien/136…
Browse files Browse the repository at this point in the history
…04-local-testing-of-github-actions

# Conflicts:
#	.eslintrc.js
#	.github/workflows/preDeploy.yml
#	.gitignore
#	package-lock.json
#	package.json
  • Loading branch information
radoslawkrzemien committed Aug 4, 2023
2 parents 1f5e336 + c3bafa6 commit 65f3fa0
Show file tree
Hide file tree
Showing 499 changed files with 25,304 additions and 17,092 deletions.
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**/node_modules/*
**/dist/*
.github/actions/**/index.js"
185 changes: 150 additions & 35 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,58 +1,173 @@
const restrictedImportPaths = [
{
name: 'react-native',
importNames: ['useWindowDimensions', 'StatusBar', 'TouchableOpacity', 'TouchableWithoutFeedback', 'TouchableNativeFeedback', 'TouchableHighlight', 'Pressable'],
message: [
'',
"For 'useWindowDimensions', please use 'src/hooks/useWindowDimensions' instead.",
"For 'TouchableOpacity', 'TouchableWithoutFeedback', 'TouchableNativeFeedback', 'TouchableHighlight', 'Pressable', please use 'PressableWithFeedback' and/or 'PressableWithoutFeedback' from 'src/components/Pressable' instead.",
"For 'StatusBar', please use 'src/libs/StatusBar' instead.",
].join('\n'),
},
{
name: 'react-native-gesture-handler',
importNames: ['TouchableOpacity', 'TouchableWithoutFeedback', 'TouchableNativeFeedback', 'TouchableHighlight'],
message: "Please use 'PressableWithFeedback' and/or 'PressableWithoutFeedback' from 'src/components/Pressable' instead.",
},
];

const restrictedImportPatterns = [
{
group: ['**/assets/animations/**/*.json'],
message: "Do not import animations directly. Please use the 'src/components/LottieAnimations' import instead.",
},
];

module.exports = {
extends: ['expensify', 'plugin:storybook/recommended', 'plugin:react-hooks/recommended', 'prettier', 'plugin:react-native-a11y/basic'],
plugins: ['react-hooks', 'react-native-a11y'],
parser: 'babel-eslint',
ignorePatterns: ['!.*', 'src/vendor', '.github/actions/**/index.js', 'desktop/dist/*.js', 'dist/*.js', 'node_modules/.bin/**', '.git/**'],
ignorePatterns: ['!.*', 'src/vendor', '.github/actions/**/index.js', 'desktop/dist/*.js', 'dist/*.js', 'node_modules/.bin/**', 'node_modules/.cache/**', '.git/**'],
env: {
jest: true,
},
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.website.js', '.desktop.js', '.native.js', '.ios.js', '.android.js', '.config.js'],
},
},
globals: {
__DEV__: 'readonly',
},
overrides: [
{
files: ['workflow_tests/**/*.js'],
files: ['*.js', '*.jsx', '*.ts', '*.tsx'],
rules: {
'@lwc/lwc/no-async-await': 'off',
'rulesdir/onyx-props-must-have-default': 'off',
'react-native-a11y/has-accessibility-hint': ['off'],
'react-native-a11y/has-valid-accessibility-descriptors': [
'error',
{
touchables: ['PressableWithoutFeedback', 'PressableWithFeedback'],
},
],
},
},
],
globals: {
__DEV__: 'readonly',
},
rules: {
'no-restricted-imports': [
'error',
{
paths: [
{
files: ['*.js', '*.jsx'],
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.website.js', '.desktop.js', '.native.js', '.ios.js', '.android.js', '.config.js', '.ts', '.tsx'],
},
},
},
rules: {
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
},
],
'no-restricted-imports': [
'error',
{
paths: restrictedImportPaths,
patterns: restrictedImportPatterns,
},
],
},
},
{
files: ['*.ts', '*.tsx'],
extends: [
'airbnb-typescript',
'plugin:@typescript-eslint/recommended-type-checked',
'plugin:@typescript-eslint/stylistic-type-checked',
'plugin:you-dont-need-lodash-underscore/all',
'prettier',
],
plugins: ['@typescript-eslint', 'jsdoc', 'you-dont-need-lodash-underscore'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json',
},
rules: {
// TODO: Remove the following rules after TypeScript migration is complete.
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',

'@typescript-eslint/naming-convention': [
'error',
{
name: 'react-native',
importNames: ['useWindowDimensions'],
message: 'Please use useWindowDimensions from src/hooks/useWindowDimensions instead',
selector: ['variable', 'property'],
format: ['camelCase', 'UPPER_CASE', 'PascalCase'],
},
{
name: 'react-native',
importNames: ['StatusBar'],
message: 'Please use StatusBar from src/libs/StatusBar instead',
selector: 'function',
format: ['camelCase', 'PascalCase'],
},
{
name: 'react-native',
importNames: ['TouchableOpacity', 'TouchableWithoutFeedback', 'TouchableNativeFeedback', 'TouchableHighlight', 'Pressable'],
message: 'Please use PressableWithFeedback and/or PressableWithoutFeedback from src/components/Pressable instead',
selector: ['typeLike', 'enumMember'],
format: ['PascalCase'],
},
{
selector: ['parameter', 'method'],
format: ['camelCase'],
},
],
'@typescript-eslint/ban-types': [
'error',
{
types: {
object: "Use 'Record<string, T>' instead.",
},
extendDefaults: true,
},
],
'@typescript-eslint/array-type': ['error', {default: 'array-simple'}],
'@typescript-eslint/prefer-enum-initializers': 'error',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-non-null-assertion': 'error',
'@typescript-eslint/switch-exhaustiveness-check': 'error',
'@typescript-eslint/consistent-type-definitions': ['error', 'type'],
'@typescript-eslint/no-floating-promises': 'off',
'es/no-nullish-coalescing-operators': 'off',
'es/no-optional-chaining': 'off',
'valid-jsdoc': 'off',
'jsdoc/no-types': 'error',
'import/no-extraneous-dependencies': 'off',
'rulesdir/prefer-underscore-method': 'off',
'rulesdir/prefer-import-module-contents': 'off',
'react/require-default-props': 'off',
'no-restricted-syntax': [
'error',
{
selector: 'TSEnumDeclaration',
message: "Please don't declare enums, use union types instead.",
},
],
'no-restricted-imports': [
'error',
{
paths: [
...restrictedImportPaths,
{
name: 'underscore',
message: 'Please use the corresponding method from lodash instead',
},
],
patterns: restrictedImportPatterns,
},
],
},
],
'react-native-a11y/has-accessibility-hint': ['off'],
'react-native-a11y/has-valid-accessibility-descriptors': [
'error',
{
touchables: ['PressableWithoutFeedback', 'PressableWithFeedback'],
},
{
files: ['workflow_tests/**/*.js'],
rules: {
'@lwc/lwc/no-async-await': 'off',
},
],
},
},
],
};
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/DesignDocIssue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: Design Doc Project Issue Template
about: A template to follow when creating a new issue related to a design doc project
---

# Part of the <Project Name> project
Main issue: <Issue Link>
Doc section: <Doc Link>
Project: <Project Link>

# Feature Description
<!-- Describe the section of the doc that this issue is covering, along with any relevant screenshots -->

# Manual Test Steps

# Automated Tests
11 changes: 6 additions & 5 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@

### Fixed Issues
<!---
1. Please postfix `$` with a URL link to the GitHub issue this Pull Request is fixing. For example, `$ https://github.com/Expensify/App/issues/123`.
2. Please postfix `PROPOSAL:` with a URL link to your GitHub comment, which contains the approved proposal (i.e. the proposal that was approved by Expensify). For example, `PROPOSAL: https://github.com/Expensify/App/issues/123#issuecomment-1369752925`
1. Please postfix `$` with a URL link to the GitHub issue this Pull Request is fixing. For example, `$ https://github.com/Expensify/App/issues/<issueID>`.
2. Please postfix `PROPOSAL:` with a URL link to your GitHub comment, which contains the approved proposal (i.e. the proposal that was approved by Expensify). For example, `PROPOSAL: https://github.com/Expensify/App/issues/<issueID>#issuecomment-1369752925`
Do NOT add the special GH keywords like `fixed` etc, we have our own process of managing the flow.
It MUST be an entire link to the github issue and your comment proposal ; otherwise, the linking and its automation will not work as expected.
Make sure this section looks similar to this (you can link multiple issues using the same formatting, just add a new line):
$ https://github.com/Expensify/App/issues/<number-of-the-issue>
$ https://github.com/Expensify/App/issues/<number-of-the-issue(comment)>
$ https://github.com/Expensify/App/issues/<issueID>
$ https://github.com/Expensify/App/issues/<issueID(comment)>
Do NOT only link the issue number like this: $ #<number-of-the-issue>
Do NOT only link the issue number like this: $ #<issueID>
--->
$
PROPOSAL:
Expand Down Expand Up @@ -113,6 +113,7 @@ This is a checklist for PR authors. Please make sure to complete all tasks and c
- [ ] If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
- [ ] If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like `Avatar` is modified, I verified that `Avatar` is working as expected in all cases)
- [ ] If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
- [ ] If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
- [ ] If a new page is added, I verified it's using the `ScrollView` component to make it scrollable when more elements are added to the page.
- [ ] If the `main` branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the `Test` steps.
- [ ] I have checked off every checkbox in the PR author checklist, including those that don't apply to this PR.
Expand Down
Loading

0 comments on commit 65f3fa0

Please sign in to comment.