Registry / devops / eslint-plugin-cflint

eslint-plugin-cflint

JSON →
library1.0.0jsnpmunverified

ESLint plugin providing two custom CloudFlare-specific linting rules: `no-substr` (prevents use of `String.prototype.substr`, considered legacy) and `no-this-assignment` (prevents assigning `this` to a variable). Current stable version is 1.0.0, initially released with no further updates. It requires ESLint as a peer dependency. Differentiators: lightweight and focused exclusively on patterns flagged internally by CloudFlare; minimal setup and no extra dependencies. Release cadence: single release, no maintenance indicated.

npm install eslint-plugin-cflint
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-CFLI
E
eslint-plugin-cflint
devopsjavascriptv1.0.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

plugin
import plugin from 'eslint-plugin-cflint'
const plugin = require('eslint-plugin-cflint')
ESM import works if project supports it; CommonJS require also works since plugin exports a single object.
rules
import { rules } from 'eslint-plugin-cflint'
const { rules } = require('eslint-plugin-cflint')
Named export for rules object, can be used in custom config.
configs
import { configs } from 'eslint-plugin-cflint'
Configs export is provided as an object; not commonly used.

Configuration to enable both CloudFlare rules and examples of code that triggers them.

// .eslintrc.js module.exports = { plugins: ['cflint'], rules: { 'cflint/no-substr': 'error', 'cflint/no-this-assignment': 'error' } }; // Example code that will be flagged: let s = 'hello'; console.log(s.substr(0, 2)); // Error: no-substr let self = this; // Error: no-this-assignment
Debug
Known issues
gotchaPlugin has only two rules; may not meet expectations for broader linting.
fix
Review the rules list; supplement with other ESLint plugins if needed.
affects: >=1.0.0
gotchaRules are deprecated within CloudFlare; no longer actively maintained.
fix
Consider using built-in ESLint rules like 'no-restricted-properties' for substr.
affects: >=1.0.0
gotchaPlugin does not provide any shared configs (e.g., 'recommended'). Must be manually configured.
fix
Add 'cflint/no-substr' and 'cflint/no-this-assignment' manually to rules.
affects: >=1.0.0
Errors
Common errors & fixes
ESLint: Failed to load plugin 'cflint': Cannot find module 'eslint-plugin-cflint'
Plugin not installed or ESLint cannot locate it.
fix
Run `npm install eslint-plugin-cflint --save-dev` and ensure node_modules contains the package.
ESLint: Configuration for rule "cflint/no-substr" is invalid. Severity should be one of: 0, 1, 2, "off", "warn", "error".
Incorrect rule severity value in ESLint config.
fix
Use 'error', 'warn', 'off' (or 2, 1, 0) as rule values.
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies
eslintrequiredPeer dependency required for plugin to function as an ESLint rule provider.
Agent activity
5 hits · last 30 days
node
4
Resources
eslint-plugin-cflint — npm install eslint-plugin-cflint · libregistry