Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
67 changes: 57 additions & 10 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
{
Expand All @@ -44,5 +35,61 @@ module.exports = {
},
},
],
'no-restricted-globals': [
Copy link
Contributor Author

@greghuels greghuels Dec 4, 2024

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.

'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',
Copy link
Contributor

Choose a reason for hiding this comment

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

👍 although looks like this is showing up in a lint-test-sdk error

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can write extension specific overrides. One sec; I'll update.

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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',
},
},
],
};
5 changes: 3 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"eslint.format.enable": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
}
}
},
"typescript.tsdk": "node_modules/typescript/lib"
}
1 change: 1 addition & 0 deletions src/application-logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export const loggerPrefix = '[Eppo SDK]';

// Create a Pino logger instance
export const logger = pino({
// eslint-disable-next-line no-restricted-globals
level: process.env.LOG_LEVEL ?? (process.env.NODE_ENV === 'production' ? 'warn' : 'info'),
// https://getpino.io/#/docs/browser
browser: { disabled: true },
Expand Down
Loading