-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix peer deps / linting / sort imports
- Loading branch information
1 parent
f3dbae5
commit 4ac26d5
Showing
55 changed files
with
1,174 additions
and
282 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import { fixupConfigRules } from "@eslint/compat"; | ||
import path from "node:path"; | ||
import { fileURLToPath } from "node:url"; | ||
import js from "@eslint/js"; | ||
import { FlatCompat } from "@eslint/eslintrc"; | ||
|
||
const __filename = fileURLToPath(import.meta.url); | ||
const __dirname = path.dirname(__filename); | ||
const compat = new FlatCompat({ | ||
baseDirectory: __dirname, | ||
recommendedConfig: js.configs.recommended, | ||
allConfig: js.configs.all | ||
}); | ||
|
||
export default [{ | ||
ignores: ["**/node_modules/", "**/dist/", "**/docs/"], | ||
}, ...fixupConfigRules(compat.extends( | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:prettier/recommended", | ||
"plugin:import/recommended", | ||
)), { | ||
settings: { | ||
"import/resolver": { | ||
node: { | ||
paths: ["packages/**"], | ||
extensions: [".ts", ".tsx", ".js", ".jsx", ".json"], | ||
}, | ||
}, | ||
|
||
"import/ignore": ["./node_modules", "./dist"], | ||
}, | ||
|
||
rules: { | ||
"@typescript-eslint/no-explicit-any": "off", | ||
|
||
"import/order": ["error", { | ||
"newlines-between": "always", | ||
groups: [["builtin", "external"], ["internal"]], | ||
|
||
pathGroups: [{ | ||
pattern: "react", | ||
group: "external", | ||
position: "before", | ||
}, { | ||
pattern: "@/**", | ||
group: "internal", | ||
position: "before", | ||
}], | ||
|
||
alphabetize: { | ||
order: "asc", | ||
caseInsensitive: true, | ||
}, | ||
}], | ||
}, | ||
}, { | ||
files: ["examples/**/*.{ts,tsx}"], | ||
rules: { | ||
"import/no-unresolved": "off", | ||
}, | ||
}]; |
Oops, something went wrong.