
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
@agoda-com/tslint
Advanced tools
A set of additional TSLint rules used on some Agoda projects.
do-not-use
Prints out a warning, that this function / method should not be used, and should get refactored if possible
A list of banned functions or methods in the following format:
"functionName"
["functionName"]
{"name": "functionName", "message": "optional explanation message"}
["functionName", "methodName", "optional message"]
{"name": ["objectName", "methodName"], "message": "optional message"}
{"name": ["foo", "bar", "baz"]}
bans foo.bar.baz()
*
) that matches everything. {"name": ["*", "forEach"]}
bans
[].forEach(...)
, $(...).forEach(...)
, arr.forEach(...)
, etc.Example:
[].forEach(e => doSomething()); // -> not allowed
Example usage:
"do-not-use": [
true,
{name: ["*", "forEach"], message: "Please refactor and use regular loops instead"},
],
root-relative-imports
Prevents traversing upwards in directory structure when importing files, forcing the use of root relative imports instead.
Example:
import { MyComponent } from './MyComponent'; // -> allowed
import { MyComponent } from './Child/MyComponent'; // -> allowed
import { MyComponent } from 'components/MyComponent'; // -> allowed
import { MyComponent } from '../components/MyComponent'; // -> not allowed
Example usage:
"root-relative-imports": true,
disallowed-in-tests
Prints out a warning, that this CallExpression should not be used in the TEST files, and should get refactored if possible.
name of the call expression you want to ban in the test files.
"object.method"
warning message you would like to give to the particular callExpression.
Example:
//myFile.test.tsx
it('all elements are loaded correctly', (done) => {
const wrapper = mount(<SomeComponent {...someComponentParams} />);
// not allowed
setTimeout(
() => {
expect(...)
}, 0);
});
Example usage:
{
"disallowed-in-tests": [
true,
{"name": "setTimeout", "message": "no setTimeout allow in test files"}
]
}
no-mount-and-snapshot
Prints out a warning, that you should not be using mount
and toMatchSnapshot
in the same test case.
Example
//myFile.test.tsx
// not allowed
it('all elements are loaded correctly', () => {
const wrapper = mount(<SomeComponent {...someComponentParams} />);
expect(enzymeToJson(wrapper)).toMatchSnapshot();
});
// allowed
it('all elements are loaded correctly', () => {
const wrapper = shallow(<SomeComponent {...someComponentParams} />);
expect(enzymeToJson(wrapper)).toMatchSnapshot();
});
// allowed
it('all elements are loaded correctly', () => {
const wrapper = mount(<SomeComponent {...someComponentParams} />);
expect(wrapper.find(myComponent).length).toBe(1);;
});
Example usage:
"no-mount-and-snapshot": true,
FAQs
A set of TSLint rules used on some Agoda projects.
The npm package @agoda-com/tslint receives a total of 0 weekly downloads. As such, @agoda-com/tslint popularity was classified as not popular.
We found that @agoda-com/tslint demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.