
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
@kouts/eslint-config
Advanced tools
Custom ESLint and Prettier config with Vue.js support and sensible defaults
[!NOTE]
Starting from v1, this ESLint config uses the ESLint Flat config and is only compatible with ESLint v9 or v8.50.0+.
If you're looking for the previous version, checkout the README here.
pnpm i -D @kouts/eslint-config eslint prettier
Add an eslint.config.js
(or eslint.config.cjs
if your project is CommonJS) that imports the config
function:
import { config } from '@kouts/eslint-config'
export default [
...config({
env: ['browser'], // Add your environment globals here
}),
{
// Add custom rules here
},
]
The configuration comes with default settings that extend the neostandard config. You can further customize it by passing an object to the config
function:
Config settings defaults:
Option | Type | Description | Default |
---|---|---|---|
ts | boolean | Enable TypeScript support | true |
noJsx | boolean | No jsx rules will be added | true |
noStyle | boolean | No style rules will be added | true |
semi | boolean | Use semicolons | false |
vue | boolean | Enable Vue.js support | true |
vueVersion | 2 or 3 | Specify the version of Vue.js | 3 |
vitest | boolean | Enable Vitest support | true |
Example:
config({
ts: false,
vue: true
vueVersion: 3,
vitest: false,
})
Create a prettier.config.js
file with the following content:
import prettierConfig from '@kouts/eslint-config/prettier'
export default prettierConfig
Add the following ESLint commands to your .package-json
for linting and autofixing:
{
"lint": "eslint \"**/*.{vue,ts,js}\"",
"lint-fix": "eslint --fix \"**/*.{vue,ts,js}\""
}
Ad the following settings to your VS Code project settings for autofix on save:
.vscode/settings.json
{
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
eslint --fix
This configuration extends the ESLint plugin Vue recommended preset but makes several modifications to enhance code quality and consistency in Vue components.
vue/max-attributes-per-line
: Turned off to allow flexibility in attribute formattingvue/singleline-html-element-content-newline
: Turned off for cleaner code with fewer line breaksvue/attributes-order
: Enforces consistent order of component attributesvue/block-order
: Enforces consistent order of component blocksvue/no-lone-template
: Prevents unnecessary template wrappersvue/no-multiple-slot-args
: Prevents passing multiple arguments to slotsvue/no-v-html
: Prevents use of v-html to mitigate XSS risksvue/order-in-components
: Enforces consistent order of component optionsvue/this-in-template
: Prevents usage of this in templatesvue/require-prop-types
: Requires type definitions for propsvue/component-name-in-template-casing
: Enforces PascalCase for component names in templatesvue/no-static-inline-styles
: Prevents inline styles in templatesvue/require-explicit-emits
: Requires explicit emit declarationsvue/require-name-property
: Requires components to have a name propertyvue/html-self-closing
: Enforces self-closing style for components with no contentvue/dot-notation
: Enforces dot notation where possible in templateskouts/vue-require-name-in-setup
: Enforces that Vue components using <script setup>
must have a component name.You can customize or disable any of these rules in your ESLint config:
// eslint.config.js
import { config } from '@kouts/eslint-config'
export default [
...config(),
{
rules: {
// Disable custom rule
'kouts/vue-require-name-in-setup': 'off',
// Modify strengthened Vue rules
'vue/attributes-order': 'warn',
'vue/no-v-html': 'off',
// Re-enable rules that were turned off
'vue/max-attributes-per-line': [
'error',
{
singleline: { max: 3 },
multiline: { max: 1 },
},
],
},
},
]
FAQs
Kouts's ESLint config
The npm package @kouts/eslint-config receives a total of 275 weekly downloads. As such, @kouts/eslint-config popularity was classified as not popular.
We found that @kouts/eslint-config demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.