Definition for rule 'simple-import-sort/imports' was not found
CsarGomez opened this issue · comments
hello im having this issue using React with Vite:
here's the vite.config.js:
at the first line of this file im getting the error message:
Definition for rule 'simple-import-sort/imports' was not found.eslint(simple-import-sort/imports)
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import path from 'path';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
server: { host: true },
resolve: {
alias: {
'@': path.resolve(__dirname, './src/'),
'@assets': path.resolve(__dirname, './src/assets'),
'@components': path.resolve(__dirname, './src/components'),
'@pages': path.resolve(__dirname, './src/pages'),
'@context': path.resolve(__dirname, './src/context'),
},
},
});
here's my aslant.json file:
{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"plugin:react/recommended",
"standard",
"plugin:react/jsx-runtime",
"eslint-config-prettier"
],
"overrides": [],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["react"],
"rules": {
"react/prop-types": "off",
"simple-import-sort/imports": [
"error",
{
"groups": [
// Packages `react` related packages come first.
["^react", "^@?\\w"],
// Internal packages.
["^(@|components)(/.*|$)"],
// Side effect imports.
["^\\u0000"],
// Parent imports. Put `..` last.
["^\\.\\.(?!/?$)", "^\\.\\./?$"],
// Other relative imports. Put same-folder imports and `.` last.
["^\\./(?=.*/)(?!/?$)", "^\\.(?!/?$)", "^\\./?$"],
// Style imports.
["^.+\\.?(css)$"]
]
}
]
}
}
Hi!
Looks like you forgot to add "simple-import-sort"
in "plugins"
:
- "plugins": ["react"],
+ "plugins": ["react", "simple-import-sort"],
you're right, my fault.
I will close the issue since is resolved after I apply the changes into the aslant plugins