Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
40366b7
Bump eslint and temporarly turn off new rules
blazejkustra Feb 20, 2024
0631318
Fix eslint running on files in a build catalog
blazejkustra Feb 20, 2024
3cc326e
Fix no-loss-of-precision
blazejkustra Feb 20, 2024
b105c6c
Fix no-promise-executor-return
blazejkustra Feb 20, 2024
472878f
Turn off no-import-assign rule in tests
blazejkustra Feb 20, 2024
9c54cb9
Fix no-unsafe-optional-chaining
blazejkustra Feb 20, 2024
5519dba
Fix react/jsx-no-useless-fragment
blazejkustra Feb 20, 2024
6f53d0d
Remove eslint-plugin-react-hooks
blazejkustra Feb 20, 2024
b7f3554
Turn off prefer-regex-literals
blazejkustra Feb 20, 2024
67aadf2
fix import/no-relative-packages and add desktop import path
blazejkustra Feb 20, 2024
6cc0b0e
Fix react/no-unused-class-component-methods
blazejkustra Feb 20, 2024
5b249d2
Disable import/no-import-module-exports in one file
blazejkustra Feb 20, 2024
3e5295f
Fix default-param-last
blazejkustra Feb 20, 2024
d6919aa
Fix sort-comp
blazejkustra Feb 20, 2024
9aadd40
Disable default-param-last
blazejkustra Feb 20, 2024
8375325
Fix react/no-unstable-nested-components
blazejkustra Feb 20, 2024
f954f5e
Add @desktop to webpack.common.js
blazejkustra Feb 20, 2024
bbb4f41
Fix webpack config
blazejkustra Feb 20, 2024
6389069
Adjust after initial review
blazejkustra Feb 20, 2024
0439c4e
Merge branch 'main' into chore/bump-eslint-config
blazejkustra Feb 20, 2024
5469b96
Merge branch 'main' into chore/bump-eslint-config
blazejkustra Feb 21, 2024
6f77a7d
Merge branch 'main' into chore/bump-eslint-config
blazejkustra Feb 22, 2024
5c4c711
Add eslint disable comment
blazejkustra Feb 22, 2024
7905a13
Merge branch 'main' into chore/bump-eslint-config
blazejkustra Feb 22, 2024
aee2c3f
Fix more no-unsafe-optional-chaining
blazejkustra Feb 22, 2024
871f559
Merge branch 'main' into chore/bump-eslint-config
blazejkustra Feb 23, 2024
259d23b
alphabetize imports
blazejkustra Feb 23, 2024
4ad944b
Extract styles to a separate variable
blazejkustra Feb 23, 2024
9dc38b9
Merge branch 'main' into chore/bump-eslint-config
blazejkustra Feb 26, 2024
9723519
Fix new fragment errors
blazejkustra Feb 26, 2024
1d46123
Merge branch 'main' into chore/bump-eslint-config
blazejkustra Feb 26, 2024
7907c17
Use string literals in favor of string concatenation
blazejkustra Feb 26, 2024
746780f
Merge branch 'main' into chore/bump-eslint-config
blazejkustra Feb 26, 2024
542d1de
Merge branch 'main' into chore/bump-eslint-config
blazejkustra Feb 27, 2024
7264c60
Remove ';' that crashes the app
blazejkustra Feb 27, 2024
f691cfd
Merge branch 'main' into chore/bump-eslint-config
blazejkustra Feb 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
**/node_modules/*
**/dist/*
android/**/build/*

@blazejkustra blazejkustra Feb 20, 2024

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes npm run lint bug that I reported two weeks ago here

.github/actions/**/index.js"
docs/vendor/**
6 changes: 4 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ const restrictedImportPatterns = [
];

module.exports = {
extends: ['expensify', 'plugin:storybook/recommended', 'plugin:react-hooks/recommended', 'plugin:react-native-a11y/basic', 'plugin:@dword-design/import-alias/recommended', 'prettier'],
plugins: ['react-hooks', 'react-native-a11y'],
extends: ['expensify', 'plugin:storybook/recommended', 'plugin:react-native-a11y/basic', 'plugin:@dword-design/import-alias/recommended', 'prettier'],
plugins: ['react-native-a11y'],
parser: 'babel-eslint',
ignorePatterns: ['!.*', 'src/vendor', '.github/actions/**/index.js', 'desktop/dist/*.js', 'dist/*.js', 'node_modules/.bin/**', 'node_modules/.cache/**', '.git/**'],
env: {
Expand All @@ -87,6 +87,7 @@ module.exports = {
files: ['*.js', '*.jsx', '*.ts', '*.tsx'],
plugins: ['react'],
rules: {
'prefer-regex-literals': 'off',
'rulesdir/no-multiple-onyx-in-file': 'off',
'rulesdir/onyx-props-must-have-default': 'off',
'react-native-a11y/has-accessibility-hint': ['off'],
Expand All @@ -112,6 +113,7 @@ module.exports = {
'@styles': './src/styles',
// This path is provide alias for files like `ONYXKEYS` and `CONST`.
'@src': './src',
'@desktop': './desktop',
},
},
],
Expand Down
15 changes: 14 additions & 1 deletion .prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,20 @@ module.exports = {
arrowParens: 'always',
printWidth: 190,
singleAttributePerLine: true,
importOrder: ['@assets/(.*)$', '@components/(.*)$', '@hooks/(.*)$', '@libs/(.*)$', '@navigation/(.*)$', '@pages/(.*)$', '@styles/(.*)$', '@userActions/(.*)$', '@src/(.*)$', '^[./]'],
/** `importOrder` should be defined in an alphabetical order. */
importOrder: [
'@assets/(.*)$',
'@components/(.*)$',
'@desktop/(.*)$',
'@hooks/(.*)$',
'@libs/(.*)$',
'@navigation/(.*)$',
'@pages/(.*)$',
'@styles/(.*)$',
'@userActions/(.*)$',
'@src/(.*)$',
'^[./]',
],
importOrderSortSpecifiers: true,
importOrderCaseInsensitive: true,
};
1 change: 1 addition & 0 deletions __mocks__/react-native-localize.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// eslint-disable-next-line import/no-import-module-exports
import mockRNLocalize from 'react-native-localize/mock';

module.exports = mockRNLocalize;
1 change: 1 addition & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ const metro = {
// This path is provide alias for files like `ONYXKEYS` and `CONST`.
'@src': './src',
'@userActions': './src/libs/actions',
'@desktop': './desktop',
},
},
],
Expand Down
1 change: 1 addition & 0 deletions config/webpack/webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ const webpackConfig = ({envFile = '.env', platform = 'web'}) => ({
// This path is provide alias for files like `ONYXKEYS` and `CONST`.
'@src': path.resolve(__dirname, '../../src/'),
'@userActions': path.resolve(__dirname, '../../src/libs/actions/'),
'@desktop': path.resolve(__dirname, '../../desktop'),
},

// React Native libraries may have web-specific module implementations that appear with the extension `.web.js`
Expand Down
7 changes: 6 additions & 1 deletion jest/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ jest.spyOn(console, 'debug').mockImplementation((...params) => {

// This mock is required for mocking file systems when running tests
jest.mock('react-native-fs', () => ({
unlink: jest.fn(() => new Promise<void>((res) => res())),
unlink: jest.fn(
() =>
new Promise<void>((res) => {
res();
}),
),
CachesDirectoryPath: jest.fn(),
}));

Expand Down
Loading