Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@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.
@deprecated
directives to have a reasonFAQs
GraphQL plugin for ESLint
The npm package @graphql-eslint/eslint-plugin receives a total of 504,628 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.