Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
eslint-plugin-civet
Advanced tools
This plugin enables using ESLint
(and optionally typescript-eslint)
directly on your .civet
files. Specifically, it provides a
processor
for converting .civet
files into TypeScript or JavaScript,
and provides some recommended rules for Civet code.
Install the plugin, along with Civet, ESLint, and (optionally) typescript-eslint if you haven't already:
npm install -D eslint-plugin-civet @danielx/civet eslint @eslint/js typescript-eslint
Here is a sample eslint.config.mjs
(ESM mode):
import civetPlugin from "eslint-plugin-civet/ts"
export default [
// Rules from eslint.configs.recommended
...civetPlugin.configs.jsRecommended,
// Rules from tseslint.configs.strict
...civetPlugin.configs.strict,
]
Here is a sample eslint.config.cjs
(CJS mode):
const civetPlugin = require("eslint-plugin-civet/ts")
module.exports = [
// Rules from eslint.configs.recommended
...civetPlugin.configs.jsRecommended,
// Rules from tseslint.configs.strict
...civetPlugin.configs.strict,
]
This will load the plugin, enable the processor for *.civet
files,
and turn on eslint's recommended rules and typescript-eslint's strict rules.
Alternatively, change configs.strict
to configs.recommended
or another of
typescript-eslint's available configurations.
If you'd rather not use typescript-eslint, and just want to
use ESLint to check your Civet code as JavaScript,
here is a sample eslint.config.mjs
(ESM mode):
import civetPlugin from "eslint-plugin-civet"
export default [
...civetPlugin.configs.recommended
]
Here is a sample eslint.config.cjs
(CJS mode):
module.exports = [
...require("eslint-plugin-civet").configs.recommended
]
This will load the plugin, enable the processor for *.civet
files,
and turn on ESLint's recommended rules. Alternatively, change
configs.recommended
to configs.all
to enable all of ESLint's rules.
Here is a sample eslint.config.mjs
that more explicitly configures
behavior for .civet
files and otherwise:
import civetPlugin from "eslint-plugin-civet"
import js from "@eslint/js"
export default [
// Enable recommended rules for all files
js.configs.recommended,
// Load plugin and enable processor for .civet files
{
files: ["**/*.civet"],
plugins: {
civet: civetPlugin,
},
processor: "civet/civet",
// Here is where you would override specific rules.
// We provide an `overrides` rule set that disables rules that
// don't work well with Civet output.
...civetPlugin.configs.overrides,
},
]
If you need to customize the Civet compiler's configuration
(beyond just js: true
vs. js: false
), import { civet }
from either "eslint-plugin-civet"
or "eslint-plugin-civet/ts" (also available as
.civet` from the default import).
This function takes an options object for the Civet compiler,
and returns a plugin:
import { civet } from "eslint-plugin-civet"
const civetPlugin = civet({
parseOptions: {
// coffeeCompat: true,
// ...
},
})
// rest as before
You can see a full working example in the example directory.
FAQs
ESLint plugin for Civet code
The npm package eslint-plugin-civet receives a total of 7 weekly downloads. As such, eslint-plugin-civet popularity was classified as not popular.
We found that eslint-plugin-civet demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.