Security News
The Push to Ban Ransom Payments Is Gaining Momentum
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
@littlemissrobot/eslint-config
Advanced tools
Readme
This package contains configurations for eslint that we, at Little Miss Robot, like to use when working with JavaScript and its frameworks!
This extension can be installed in the project as an npm package and can be
extended in the project eslint configuration. Does this mean you are dependant
on these settings? No, these values can be overwritten in that project eslint
configuration under the rules
key.
This package contains 4 types of configs:
Use the right one for the installed framework in your project. We also like to use prettier to make sure our code formatting is consistent and we don't have to worry about stylistic issues.
$ npm install --save-dev @littlemissrobot/eslint-config
module.exports = {
extends: ["@littlemissrobot/eslint-config"],
};
// Base (no specific framework)
module.exports = {
extends: [
"@littlemissrobot/eslint-config",
"@littlemissrobot/eslint-config/linters/base",
],
};
// React
module.exports = {
extends: [
"@littlemissrobot/eslint-config",
"@littlemissrobot/eslint-config/linters/react",
],
};
// Vue3
module.exports = {
extends: [
"@littlemissrobot/eslint-config",
"@littlemissrobot/eslint-config/linters/vue3",
],
};
// Nuxt
module.exports = {
extends: [
"@littlemissrobot/eslint-config",
"@littlemissrobot/eslint-config/linters/nuxt",
],
};
overrides
key. For
example, the one we like to use:{
"printWidth": 80,
"tabWidth": 4,
"useTabs": true,
"semi": true,
"singleQuote": false,
"quoteProps": "as-needed",
"jsxSingleQuote": false,
"trailingComma": "es5",
"bracketSpacing": true,
"bracketSameLine": false,
"arrowParens": "always",
"htmlWhitespaceSensitivity": "css",
"vueIndentScriptAndStyle": false,
"endOfLine": "lf",
"overrides": [
{
"files": [
"package.json",
".composer.json",
"*.yml",
"*.md",
"*.php"
],
"options": {
"useTabs": false
}
},
{
"files": ["package.json", "*.yml", "*.md"],
"options": {
"tabWidth": 2
}
},
{
"files": ["composer.json", "*.php"],
"options": {
"tabWidth": 4
}
}
]
}
When you work with webpack and you define certain aliasses like @
referring to
./src
, eslint will consider this as a rule break on import/no-unresolved
. It
will log an error like Unable to resolve path to module '@/components'
for
example.
This can be fixed by installing the package eslint-import-resolver-webpack
and
adding the location to the webpack config in your eslint configuration file:
{
settings: {
"import/resolver": {
webpack: {
config: "./.webpack/webpack.dev.js",
},
},
},
}
An alternative fix could be to add this setting with the location of the
directory the alias @
points to:
{
settings: {
"import/resolver": {
node: {
paths: ["./src"],
extensions: [".mjs", ".js", ".json"],
},
},
},
}
FAQs
Little Miss Robot default eslint configuration/rules
We found that @littlemissrobot/eslint-config 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
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
Application Security
New SEC disclosure rules aim to enforce timely cyber incident reporting, but fear of job loss and inadequate resources lead to significant underreporting.
Security News
The Python Software Foundation has secured a 5-year sponsorship from Fastly that supports PSF's activities and events, most notably the security and reliability of the Python Package Index (PyPI).