
Security News
OpenGrep Restores Fingerprinting in JSON and SARIF Outputs
OpenGrep has restored fingerprint and metavariable support in JSON and SARIF outputs, making static analysis more effective for CI/CD security automation.
@blueprint-modernized/eslint-plugin
Advanced tools
ESLint rules for use with @blueprint-modernized packages
Blueprint is a React UI toolkit for the web.
This package contains the ESLint plugin for Blueprint. It provides custom rules which are useful when developing against Blueprint libraries.
Key features:
@blueprint-modernized
components.yarn add --dev @blueprint-modernized/eslint-plugin
Simply add this plugin in your .eslintrc
file to use the add the plugin. The plugin includes Blueprint-specific rules which enforce semantics particular to usage with @blueprint-modernized
packages, but does not turn them on by default.
.eslintrc
plugins: [
"@blueprint-modernized"
]
To enable the Blueprint-specific rules, extend the plugin:@blueprint-modernized/recommended
config inside the package:
tslint.json
extends: [
+ "plugin:@blueprint-modernized/recommended"
]
@blueprint-modernized/classes-constants
Enforce usage of Classes
constants over namespaced string literals.
Each @blueprint-modernized
package exports a Classes
object that contains constants for every CSS class defined by the package. While the values of the constants may change between releases, the names of the constants will remain more stable.
{
"rules": {
"@blueprint-modernized/classes-constants": ["error"]
}
}
-const element = <div className="pt-navbar" />;
+const element = <div className={Classes.NAVBAR} />;
@blueprint-modernized/html-components
Enforce usage of Blueprint components over regular html components.
{
"rules": {
"@blueprint-modernized/html-components": ["error"],
}
}
@blueprint-modernized/icon-components
Enforce usage of JSX Icon
components over IconName
string literals (or vice-versa) in icon
JSX props. Note that this rule only supports hardcoded values in the icon
prop; it does not handle expressions or conditionals.
A fixer is available for this rule that will convert between string literals and named Icon
components. Note that the implementation is naive and may require intervention, such as to import a component or fix an invalid name.
Named icon components (TickIcon
, GraphIcon
, etc) can be imported from the @blueprint-modernized/icons
package.
This rule is disabled in the blueprint-rules
config as it is most useful to ensure that the @blueprint-modernized/icons
package can be tree-shaken (an opt-in process which requires using components and never IconName
literals).
{
"rules": {
// default uses "component"
"@blueprint-modernized/icon-components": ["error"],
// expanded syntax
"@blueprint-modernized/icon-components": ["error", "component" | "literal"] // choose one
}
}
"component"
-<Button icon="tick" />
+<Button icon={<TickIcon />} />
"literal"
-<Button icon={<GraphIcon />} />
+<Button icon="graph" />
FAQs
ESLint rules for use with @blueprint-modernized packages
We found that @blueprint-modernized/eslint-plugin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
OpenGrep has restored fingerprint and metavariable support in JSON and SARIF outputs, making static analysis more effective for CI/CD security automation.
Security News
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
Security Fundamentals
Attackers use obfuscation to hide malware in open source packages. Learn how to spot these techniques across npm, PyPI, Maven, and more.