Merged in feat/add-no-relative-packages-rule (pull request #2356)
Add eslint rule no-relative-packages * Add eslint rule no-relative-packages Approved-by: Christian Andolf
This commit is contained in:
@@ -27,7 +27,7 @@ export default defineConfig([
|
|||||||
rules: {
|
rules: {
|
||||||
"no-unused-vars": "off",
|
"no-unused-vars": "off",
|
||||||
"react/function-component-definition": "error",
|
"react/function-component-definition": "error",
|
||||||
|
"import/no-relative-packages": "error",
|
||||||
"simple-import-sort/imports": [
|
"simple-import-sort/imports": [
|
||||||
"error",
|
"error",
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import typescriptEslint from "@typescript-eslint/eslint-plugin"
|
|||||||
import tsParser from "@typescript-eslint/parser"
|
import tsParser from "@typescript-eslint/parser"
|
||||||
import { defineConfig } from "eslint/config"
|
import { defineConfig } from "eslint/config"
|
||||||
import simpleImportSort from "eslint-plugin-simple-import-sort"
|
import simpleImportSort from "eslint-plugin-simple-import-sort"
|
||||||
|
import importPlugin from "eslint-plugin-import"
|
||||||
|
|
||||||
const compat = new FlatCompat({
|
const compat = new FlatCompat({
|
||||||
recommendedConfig: js.configs.recommended,
|
recommendedConfig: js.configs.recommended,
|
||||||
@@ -17,6 +18,7 @@ export default defineConfig([
|
|||||||
plugins: {
|
plugins: {
|
||||||
"simple-import-sort": simpleImportSort,
|
"simple-import-sort": simpleImportSort,
|
||||||
"@typescript-eslint": typescriptEslint,
|
"@typescript-eslint": typescriptEslint,
|
||||||
|
import: importPlugin,
|
||||||
},
|
},
|
||||||
|
|
||||||
linterOptions: {
|
linterOptions: {
|
||||||
@@ -29,7 +31,7 @@ export default defineConfig([
|
|||||||
|
|
||||||
rules: {
|
rules: {
|
||||||
"no-unused-vars": "off",
|
"no-unused-vars": "off",
|
||||||
|
"import/no-relative-packages": "error",
|
||||||
"simple-import-sort/imports": [
|
"simple-import-sort/imports": [
|
||||||
"error",
|
"error",
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import tsParser from '@typescript-eslint/parser'
|
|||||||
import reactRefresh from 'eslint-plugin-react-refresh'
|
import reactRefresh from 'eslint-plugin-react-refresh'
|
||||||
import { FlatCompat } from '@eslint/eslintrc'
|
import { FlatCompat } from '@eslint/eslintrc'
|
||||||
import js from '@eslint/js'
|
import js from '@eslint/js'
|
||||||
|
import importPlugin from 'eslint-plugin-import'
|
||||||
|
|
||||||
const compat = new FlatCompat({
|
const compat = new FlatCompat({
|
||||||
recommendedConfig: js.configs.recommended,
|
recommendedConfig: js.configs.recommended,
|
||||||
@@ -26,8 +27,10 @@ export default defineConfig([
|
|||||||
),
|
),
|
||||||
plugins: {
|
plugins: {
|
||||||
'react-refresh': reactRefresh,
|
'react-refresh': reactRefresh,
|
||||||
|
import: importPlugin,
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
|
'import/no-relative-packages': 'error',
|
||||||
'react-refresh/only-export-components': [
|
'react-refresh/only-export-components': [
|
||||||
'warn',
|
'warn',
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -158,6 +158,7 @@
|
|||||||
"copy-to-clipboard": "^3.3.3",
|
"copy-to-clipboard": "^3.3.3",
|
||||||
"deepmerge-ts": "^7.1.5",
|
"deepmerge-ts": "^7.1.5",
|
||||||
"eslint": "^9",
|
"eslint": "^9",
|
||||||
|
"eslint-plugin-import": "^2.31.0",
|
||||||
"eslint-plugin-react-hooks": "^5.2.0",
|
"eslint-plugin-react-hooks": "^5.2.0",
|
||||||
"eslint-plugin-react-refresh": "^0.4.20",
|
"eslint-plugin-react-refresh": "^0.4.20",
|
||||||
"eslint-plugin-storybook": "^0.12.0",
|
"eslint-plugin-storybook": "^0.12.0",
|
||||||
|
|||||||
@@ -6995,6 +6995,7 @@ __metadata:
|
|||||||
copy-to-clipboard: "npm:^3.3.3"
|
copy-to-clipboard: "npm:^3.3.3"
|
||||||
deepmerge-ts: "npm:^7.1.5"
|
deepmerge-ts: "npm:^7.1.5"
|
||||||
eslint: "npm:^9"
|
eslint: "npm:^9"
|
||||||
|
eslint-plugin-import: "npm:^2.31.0"
|
||||||
eslint-plugin-react-hooks: "npm:^5.2.0"
|
eslint-plugin-react-hooks: "npm:^5.2.0"
|
||||||
eslint-plugin-react-refresh: "npm:^0.4.20"
|
eslint-plugin-react-refresh: "npm:^0.4.20"
|
||||||
eslint-plugin-storybook: "npm:^0.12.0"
|
eslint-plugin-storybook: "npm:^0.12.0"
|
||||||
|
|||||||
Reference in New Issue
Block a user