Skip to content

Commit

Permalink
create separate lint calls for different subfolders & exclude them fr…
Browse files Browse the repository at this point in the history
…om eslint ignore to enable ide highlights
  • Loading branch information
robertKozik committed Jan 16, 2024
1 parent a450039 commit dfab75f
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 10 deletions.
14 changes: 7 additions & 7 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
**/node_modules/*
parser/react-native-live-markdown-parser.js

# any js file inside android and ios folders
android/**/*.js
ios/**/*.js

# Ignore all files inside subproject folders
example/**/*
WebExample/**/*
parser/**/*
**/android/**/*.js
**/ios/**/*.js

# Output of the build process & scripts
lib/**/*
scripts/**/*

babel.config.js
metro.config.js
react-native.config.js
jest.config.js
webpack.config.js
.eslintrc.js
.prettierrc.js
4 changes: 3 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ module.exports = {
project: true,
tsconfigRootDir: __dirname,
},
env: {
jest: true,
},
extends: [
'expensify',
'plugin:@typescript-eslint/recommended-type-checked',
Expand Down Expand Up @@ -46,7 +49,6 @@ module.exports = {
"error",
"ignorePackages",
{
"js": "never",
"jsx": "never",
"ts": "never",
"tsx": "never"
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function getPlatform() {
}
// @ts-expect-error it works
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return Platform.constants.systemName || Platform.constants.Brand;
return Platform.constants.systemName ?? Platform.constants.Brand;
}

function getPlatformVersion() {
Expand Down
2 changes: 1 addition & 1 deletion example/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"compilerOptions": {
"strict": true
},
"include": ["src/App.tsx"],
"include": ["src/App.tsx", "./index.ts"],
"exclude": ["node_modules"]
}
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
"test": "jest",
"typecheck": "tsc --noEmit",
"lint": "eslint . --ext .js,.ts,.tsx",
"lint:root": "eslint . --ext .js,.ts,.tsx --ignore-pattern '/example/**/*' --ignore-pattern '/WebExample/**/*' --ignore-pattern '/parser/**/*'",
"lint:example": "eslint example --ext .js,.ts,.tsx",
"lint:parser": "eslint parser --ext .js,.ts,.tsx",
"lint:web": "eslint WebExample --ext .js,.ts,.tsx",
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
"prepare": "bob build",
"release": "release-it"
Expand Down

0 comments on commit dfab75f

Please sign in to comment.