Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@bassist/eslint
Advanced tools
Flat ESLint config for JavaScript, TypeScript, Vue, React, Svelte, Prettier and so on by @chengpeiquan .
Flat ESLint config for ESLint by @chengpeiquan .
With npm(or yarn, or pnpm):
npm install -D eslint @bassist/eslint
Yeah, this is a ESLint configuration, so you need to install ESLint at the same time.
If using TypeScript's Lint configuration, also make sure TypeScript is installed.
Requires ESLint >= 8.0.0
, and TypeScript >= 5.0.0
.
Create a configuration file named eslint.config.js
in the root path of the project.
If using another filename (e.g.
eslint.config.cjs
oreslint.config.mjs
), please use the--config
command line option to specify your config.
You can import the desired presets depending on the type of project, please remember that each config is an array, and the default export is also an array.
// eslint.config.js
import { prettier, vue } from '@bassist/eslint'
export default [...prettier, ...vue]
Yeah, the config file cannot be a file name such as .eslintrc.js
or .eslintrc.json
and so on, see Migration .
Next, add the "type": "module"
setting and a lint script in the project's package.json
.
{
"type": "module",
"scripts": {
"lint": "eslint src"
}
}
In lint script, src
is your source code folder, please adjust it according to the actual situation.
You can run npm run lint
to start linting the code.
If you need to adjust or add configuration, it is recommended to wrap the configuration through the defineFlatConfig
of defineConfig
(Alias) API to get a better configuration experience.
Remember use // @ts-check
at the first line in your eslint.config.js
.
// @ts-check
import { defineFlatConfig, prettier, vue } from '@bassist/eslint'
export default defineFlatConfig([
...prettier,
...vue,
{
rules: {
// By default, this rule is `off`
'vue/component-tags-order': 'error',
},
ignores: ['examples'],
},
])
See eslint-define-config to learn more.
Please turn on this setting, which can solve VS Code's error reporting to eslint.config.js
.
{
"eslint.experimental.useFlatConfig": true
}
In order not to affect other irrelevant projects, it is highly recommended that this setting only take effect in the workspace, not globally. So please fill it into .vscode/settings.json
.
This package exports some config of ESLint, which can be imported via named.
Helper functions and types for type checking are provided here (See: Usage with type checking).
Typescript rules are built-in when using framework presets.
@bassist/eslint/svelte
)--ext
option, see: #16991 ."type": "module"
to support ES Module, see: Configuration .If you want to migrate your ESLint configuration file from the eslintrc format (typically configured in .eslintrc.js
or .eslintrc.json
files) to the new flat config format (typically configured in an eslint.config.js
file).
See: Configuration Migration Guide
Related Reading:
Please refer to CHANGELOG for details.
MIT License © 2023-PRESENT chengpeiquan
FAQs
Flat ESLint config for JavaScript, TypeScript, Vue, React, Prettier and so on by @chengpeiquan .
The npm package @bassist/eslint receives a total of 7 weekly downloads. As such, @bassist/eslint popularity was classified as not popular.
We found that @bassist/eslint 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.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.