Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@graphql-eslint/eslint-plugin
Advanced tools
@graphql-eslint/eslint-plugin is an ESLint plugin that provides linting rules for GraphQL schema and operations. It helps developers enforce best practices, catch errors early, and maintain consistency in their GraphQL code.
Linting GraphQL Schema
This feature allows you to lint your GraphQL schema files. The example configuration enforces rules to ensure that all type names are known and warns about deprecated fields.
module.exports = {
'plugins': ['@graphql-eslint'],
'overrides': [
{
'files': ['*.graphql'],
'parser': '@graphql-eslint/eslint-plugin',
'rules': {
'@graphql-eslint/known-type-names': 'error',
'@graphql-eslint/no-deprecated': 'warn'
}
}
]
};
Linting GraphQL Operations
This feature allows you to lint GraphQL operations within your JavaScript files. The example configuration enforces rules to ensure that there are no unused fields and that the 'id' field is used when available.
module.exports = {
'plugins': ['@graphql-eslint'],
'overrides': [
{
'files': ['*.js'],
'processor': '@graphql-eslint/graphql',
'rules': {
'@graphql-eslint/no-unused-fields': 'error',
'@graphql-eslint/require-id-when-available': 'warn'
}
}
]
};
Custom Rules
This feature allows you to define custom linting rules for your GraphQL code. The example configuration shows how to set up a custom rule with specific options.
module.exports = {
'plugins': ['@graphql-eslint'],
'rules': {
'@graphql-eslint/custom-rule': [
'error',
{
'ruleOption': 'value'
}
]
}
};
eslint-plugin-graphql is another ESLint plugin that provides GraphQL linting capabilities. It focuses on validating GraphQL queries and schema definitions within JavaScript files. Compared to @graphql-eslint/eslint-plugin, it has fewer built-in rules and less flexibility for custom rules.
graphql-schema-linter is a standalone tool for linting GraphQL schemas. It provides a set of rules to enforce best practices and catch common errors in schema definitions. Unlike @graphql-eslint/eslint-plugin, it does not integrate directly with ESLint and is used as a separate command-line tool.
graphql-eslint is a package that provides a set of ESLint rules for GraphQL. It is similar to @graphql-eslint/eslint-plugin but focuses more on providing a comprehensive set of rules for both schema and operations. It also offers better integration with various GraphQL tools and libraries.
https://the-guild.dev/graphql/eslint
Contributions, issues and feature requests are very welcome. If you are using this package and fixed a bug for yourself, please consider submitting a PR!
And if this is your first time contributing to this project, please do read our Contributor Workflow Guide before you get started off.
Help us keep GraphQL ESLint open and inclusive. Please read and follow our Code of Conduct as adopted from Contributor Covenant.
Released under the MIT license.
FAQs
GraphQL plugin for ESLint
The npm package @graphql-eslint/eslint-plugin receives a total of 507,061 weekly downloads. As such, @graphql-eslint/eslint-plugin popularity was classified as popular.
We found that @graphql-eslint/eslint-plugin demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.