-
Notifications
You must be signed in to change notification settings - Fork 1
chore: prevent native node functions from leaking to js #158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,18 +14,9 @@ module.exports = { | |
], | ||
plugins: ['@typescript-eslint', 'prettier', 'import', 'promise', 'unused-imports'], | ||
rules: { | ||
'prettier/prettier': [ | ||
'warn', | ||
{ | ||
singleQuote: true, | ||
trailingComma: 'all', | ||
printWidth: 100, | ||
}, | ||
], | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
'import/named': 'off', | ||
'import/no-unresolved': 'off', | ||
'unused-imports/no-unused-imports': 'error', | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
'import/order': [ | ||
'warn', | ||
{ | ||
|
@@ -44,5 +35,61 @@ module.exports = { | |
}, | ||
}, | ||
], | ||
'no-restricted-globals': [ | ||
'error', | ||
{ | ||
name: '__dirname', | ||
message: 'Not available in JavaScript', | ||
}, | ||
{ | ||
name: '__filename', | ||
message: 'Not available in JavaScript', | ||
}, | ||
{ | ||
name: 'atob', | ||
message: | ||
"'atob' unavailable in React Native 0.72. Use 'decodeBase64' helper in src/obfuscation.ts instead", | ||
}, | ||
{ | ||
name: 'btoa', | ||
message: | ||
"'btoa' unavailable in React Native 0.72. Use 'encodeBase64' helper in src/obfuscation.ts instead", | ||
}, | ||
{ | ||
name: 'Buffer', | ||
message: | ||
"'Buffer' unavailable in JavaScript. Use 'Uint8Array' instead. For Base64, use helpers in src/obfuscation.ts", | ||
}, | ||
{ | ||
name: 'clearImmediate', | ||
message: "'clearImmediate' unavailable in JavaScript.", | ||
}, | ||
{ | ||
name: 'process', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 although looks like this is showing up in a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can write extension specific overrides. One sec; I'll update. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updated! |
||
message: | ||
"'process' unavailable in JavaScript. If this is already defined in webpack.config.js, you can safely disable the error for this line.", | ||
}, | ||
{ | ||
name: 'setImmediate', | ||
message: "'setImmediate' unavailable in JavaScript. Use 'setTimeout(fn, 0)' instead", | ||
}, | ||
], | ||
'prettier/prettier': [ | ||
'warn', | ||
{ | ||
singleQuote: true, | ||
trailingComma: 'all', | ||
printWidth: 100, | ||
}, | ||
], | ||
'unused-imports/no-unused-imports': 'error', | ||
}, | ||
overrides: [ | ||
{ | ||
files: ['*.spec.ts'], | ||
rules: { | ||
'no-restricted-globals': 'off', | ||
}, | ||
}, | ||
], | ||
}; |
Uh oh!
There was an error while loading. Please reload this page.
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.
This is the rule that was added. Other rules were just sorted alphabetically.