language-tools
language-tools copied to clipboard
How to add your rules to my ESLint config?
I have searched that your package is now out of the box inside WebStorm 2023.2 beta build 232.8660.7
Your linter starts show me errors that i previously don't see at all 🙂
But if I run lint command, i don't see them inside it, how can I update my config?
My .eslintrc.cjs
is slightly big, but it is here 👇 :
module.exports = {
env: {
browser: true,
es2021: true,
node: true,
},
extends: [
'plugin:vue/vue3-recommended',
'eslint:recommended',
'@vue/typescript/recommended',
'prettier',
'plugin:storybook/recommended',
'plugin:@typescript-eslint/strict',
'plugin:@typescript-eslint/strict-type-checked',
],
overrides: [],
parser: 'vue-eslint-parser',
parserOptions: {
parser: {
js: '@typescript-eslint/parser',
ts: '@typescript-eslint/parser',
'<template>': 'espree',
},
ecmaVersion: 2015,
sourceType: 'module',
allowImportExportEverywhere: true,
project: true,
tsconfigRootDir: __dirname,
},
plugins: ['@typescript-eslint', 'prettier', 'simple-import-sort'],
rules: {
'vue/require-default-prop': 'off',
'vue/no-v-model-argument': 'off',
'vue/multi-word-component-names': 'off',
'vue/no-multiple-template-root': 0,
'vue/component-name-in-template-casing': [
'error',
'kebab-case',
{
registeredComponentsOnly: true,
},
],
'@typescript-eslint/await-thenable': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-for-in-array': 'error',
'@typescript-eslint/no-non-null-asserted-optional-chain': 'error',
'@typescript-eslint/array-type': [
'error',
{ default: 'array-simple', readonly: 'array-simple' },
],
'@typescript-eslint/prefer-optional-chain': 'error',
'no-implied-eval': 'off',
'@typescript-eslint/no-implied-eval': 'error',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'error',
'require-await': 'off',
'@typescript-eslint/require-await': 'error',
'default-param-last': ['error'],
'@typescript-eslint/consistent-type-imports': [
'error',
{
prefer: 'type-imports',
},
],
'no-restricted-imports': [
'error',
{
patterns: ['../'],
},
],
'@typescript-eslint/no-duplicate-enum-values': 'error',
'@typescript-eslint/no-duplicate-type-constituents': 'error',
'@typescript-eslint/no-inferrable-types': 'error',
'@typescript-eslint/method-signature-style': ['error', 'property'],
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'variable',
types: ['boolean'],
format: ['PascalCase'],
prefix: ['is', 'should', 'has', 'can', 'did', 'will'],
},
{
selector: 'typeParameter',
format: ['PascalCase'],
prefix: ['T'],
},
{
selector: 'interface',
format: ['PascalCase'],
custom: {
regex: '^I[A-Z]',
match: false,
},
},
{
selector: ['variable', 'function'],
format: ['camelCase'],
leadingUnderscore: 'allow',
},
],
'vue/block-lang': [
'error',
{
script: {
lang: 'ts',
},
},
],
'vue/define-props-declaration': ['error', 'type-based'],
'vue/new-line-between-multi-line-property': [
'error',
{
minLineOfMultilineProperty: 4,
},
],
'vue/padding-line-between-tags': [
'error',
[{ blankLine: 'always', prev: '*', next: '*' }],
],
'simple-import-sort/imports': [
'error',
{
groups: [
// Packages `Vue` related packages come first.
['^vue', '^@?\\w'],
// Components
['^@/components?\\w'],
// Enums
['^@/ts/enums?\\w'],
// Interfaces
['^@/ts/interfaces?\\w'],
// Utils
['^@/utils?\\w'],
// Store
['^pinia', '^@/stores?\\w'],
// Absolute imports and other imports such as Vue-style `@/foo`.
// Anything not matched in another group.
['^'],
// Relative imports.
// Anything that starts with a dot.
['^\\.'],
],
},
],
'simple-import-sort/exports': 'error',
},
root: true,
};