-
Notifications
You must be signed in to change notification settings - Fork 839
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* adds eslint web,native,node * adds updates * adds core * test * adds tsconifg * update yarn * adds root:true
- Loading branch information
Showing
21 changed files
with
1,476 additions
and
1,834 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
**/node_modules/** | ||
**/dist/** | ||
**/build/** | ||
**/dev/** | ||
|
||
**/.expo/** | ||
**/.next/** | ||
**/__generated__/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,4 @@ | ||
module.exports = { | ||
root: true, | ||
extends: ["custom"], | ||
parserOptions: { | ||
tsconfigRootDir: __dirname, | ||
project: ["./tsconfig.json"], | ||
}, | ||
extends: ["custom/native"], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/__tests__/fixtures/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module.exports = { | ||
root: true, | ||
extends: "./node.js", | ||
settings: { react: { version: "1000.0.0" } }, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
const [IGNORE, WARNING, ERROR] = [0, 1, 2]; | ||
|
||
module.exports = { | ||
root: true, | ||
extends: [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
const { | ||
jsExtensions, | ||
tsExtensions, | ||
platformSubextensions, | ||
computeExpoExtensions, | ||
} = require("./shared/extensions"); | ||
|
||
const allExtensions = computeExpoExtensions( | ||
[...jsExtensions, ...tsExtensions], | ||
platformSubextensions | ||
); | ||
|
||
module.exports = { | ||
extends: [ | ||
"./index.js", | ||
// './shared/core.js', | ||
"./shared/typescript.js", | ||
"./shared/react.js", | ||
], | ||
globals: { | ||
__DEV__: false, | ||
Atomics: false, | ||
ErrorUtils: false, | ||
FormData: false, | ||
SharedArrayBuffer: false, | ||
XMLHttpRequest: false, | ||
alert: false, | ||
cancelAnimationFrame: false, | ||
cancelIdleCallback: false, | ||
clearImmediate: false, | ||
clearInterval: false, | ||
clearTimeout: false, | ||
fetch: false, | ||
navigator: false, | ||
process: false, | ||
requestAnimationFrame: false, | ||
requestIdleCallback: false, | ||
setImmediate: false, | ||
setInterval: false, | ||
setTimeout: false, | ||
window: false, | ||
}, | ||
settings: { | ||
"import/extensions": allExtensions, | ||
"import/resolver": { | ||
node: { extensions: allExtensions }, | ||
}, | ||
}, | ||
overrides: [ | ||
{ | ||
files: ["*.web.*"], | ||
env: { browser: true }, | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module.exports = { | ||
extends: ["./shared/core.js", "./shared/typescript.js"], | ||
plugins: ["node"], | ||
env: { node: true }, | ||
rules: { | ||
"no-buffer-constructor": "warn", | ||
"node/no-path-concat": "warn", | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,48 @@ | ||
{ | ||
"name": "eslint-config-custom", | ||
"version": "0.0.1", | ||
"description": "Shared ESLINT config for universl Backpack projects across web, native and node", | ||
"version": "1.0.0", | ||
"main": "index.js", | ||
"private": true, | ||
"scripts": { | ||
"lint": "eslint .", | ||
"test": "jest" | ||
}, | ||
"jest": { | ||
"testMatch": [ | ||
"**/__tests__/*-test.js" | ||
] | ||
}, | ||
"eslintIgnore": [ | ||
"/__tests__/fixtures/*" | ||
], | ||
"dependencies": { | ||
"@typescript-eslint/eslint-plugin": "^5.40.1", | ||
"@typescript-eslint/parser": "^5.40.1", | ||
"eslint": "latest", | ||
"eslint-config-next": "latest", | ||
"eslint-config-prettier": "latest", | ||
"eslint-config-turbo": "latest", | ||
"@typescript-eslint/eslint-plugin": "^5.45.1", | ||
"@typescript-eslint/parser": "^5.45.1", | ||
"eslint-config-next": "^13.1.1", | ||
"eslint-config-prettier": "^8.5.0", | ||
"eslint-config-turbo": "^0.0.7", | ||
"eslint-import-resolver-node": "^0.3.6", | ||
"eslint-import-resolver-typescript": "^3.5.1", | ||
"eslint-plugin-import": "^2.26.0", | ||
"eslint-plugin-mui-unused-classes": "^1.0.3", | ||
"eslint-plugin-react": "latest", | ||
"eslint-plugin-node": "^11.1.0", | ||
"eslint-plugin-react": "^7.30.1", | ||
"eslint-plugin-react-hooks": "^4.6.0", | ||
"eslint-plugin-workspaces": "^0.7.0" | ||
}, | ||
"peerDependencies": { | ||
"eslint": ">=8.18", | ||
"prettier": ">=2.7" | ||
}, | ||
"peerDependenciesMeta": { | ||
"prettier": { | ||
"optional": true | ||
} | ||
}, | ||
"devDependencies": { | ||
"eslint": "^8.31.0", | ||
"jest": "^27.5.1", | ||
"prettier": "^2.8.1" | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
packages/eslint-config-custom/shared/__tests__/extensions-test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// https://github.com/expo/expo/blob/main/packages/eslint-config-universe/shared/__tests__/extensions-test.js | ||
const { | ||
jsExtensions, | ||
platformSubextensions, | ||
computeExpoExtensions, | ||
} = require("../extensions"); | ||
|
||
it(`orders more specific platform subextensions first`, () => { | ||
const androidIndex = platformSubextensions.indexOf(".android"); | ||
const iosIndex = platformSubextensions.indexOf(".ios"); | ||
const nativeIndex = platformSubextensions.indexOf(".native"); | ||
|
||
expect(androidIndex).toBeGreaterThanOrEqual(0); | ||
expect(iosIndex).toBeGreaterThanOrEqual(0); | ||
expect(nativeIndex).toBeGreaterThanOrEqual(0); | ||
|
||
expect(androidIndex).toBeLessThan(nativeIndex); | ||
expect(iosIndex).toBeLessThan(nativeIndex); | ||
}); | ||
|
||
it(`orders Expo-specific extensions first`, () => { | ||
const extensions = computeExpoExtensions(jsExtensions, platformSubextensions); | ||
const jsIndex = extensions.indexOf(".js"); | ||
const expoJsIndex = extensions.indexOf(".expo.js"); | ||
|
||
expect(jsIndex).toBeGreaterThanOrEqual(0); | ||
expect(expoJsIndex).toBeGreaterThanOrEqual(0); | ||
|
||
expect(expoJsIndex).toBeLessThan(jsIndex); | ||
}); |
Oops, something went wrong.
ff66919
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
backpack – ./
www.backpack.app
backpack-git-master-200ms.vercel.app
backpack-200ms.vercel.app
devnet.backpack.app
backpack.app