-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use shared config (local package atm)
- Loading branch information
1 parent
e4aa17f
commit b67b7b4
Showing
3 changed files
with
58 additions
and
90 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,94 +1,15 @@ | ||
import eslint from "@eslint/js"; | ||
import importPlugin from "eslint-plugin-import"; | ||
import jsxA11y from "eslint-plugin-jsx-a11y"; | ||
import prettierRecommended from "eslint-plugin-prettier/recommended"; | ||
import reactPlugin from "eslint-plugin-react"; | ||
import storybook from "eslint-plugin-storybook"; | ||
import globals from "globals"; | ||
import tseslint from "typescript-eslint"; | ||
import { ignoreBuildArtifacts } from "@maykinmedia/eslint-config"; | ||
import recommended from "@maykinmedia/eslint-config/recommended"; | ||
|
||
const config = [ | ||
ignoreBuildArtifacts(["build", "storybook-static"]), | ||
...recommended, | ||
{ | ||
name: "project:ignore build artifacts", | ||
ignores: ["build/**/*", "storybook-static/**/*"], | ||
}, | ||
{ | ||
name: "project:environment", | ||
settings: { | ||
react: { | ||
version: "detect", | ||
}, | ||
}, | ||
languageOptions: { | ||
globals: { | ||
...globals.builtin, | ||
...globals.browser, | ||
}, | ||
}, | ||
}, | ||
// Standard JS rules | ||
eslint.configs.recommended, | ||
// eslint-disable-next-line import/no-named-as-default-member | ||
...tseslint.configs.recommended, | ||
// Import/export linting | ||
{ | ||
settings: { | ||
"import/resolver": { | ||
node: true, | ||
typescript: true, | ||
}, | ||
}, | ||
...importPlugin.flatConfigs.recommended, | ||
languageOptions: { | ||
...importPlugin.flatConfigs.recommended.languageOptions, | ||
ecmaVersion: "latest", | ||
}, | ||
name: "project:react-hooks:disable-exhaustive-deps", | ||
rules: { | ||
...importPlugin.flatConfigs.recommended.rules, | ||
"import/first": "error", | ||
"import/no-amd": "error", | ||
"import/no-anonymous-default-export": "warn", | ||
"import/no-webpack-loader-syntax": "error", | ||
}, | ||
}, | ||
importPlugin.flatConfigs.typescript, | ||
// React-specific linting | ||
jsxA11y.flatConfigs.recommended, | ||
{ | ||
name: "react/recommended", | ||
...reactPlugin.configs.flat.recommended, | ||
}, | ||
{ | ||
name: "react/jsx-runtime", | ||
...reactPlugin.configs.flat["jsx-runtime"], | ||
}, | ||
{ | ||
name: "prettier/recommended", | ||
...prettierRecommended, | ||
}, | ||
// Storybook stories | ||
...storybook.configs["flat/recommended"], | ||
{ | ||
name: "project:storybook:check-config", | ||
ignores: ["!.storybook"], | ||
}, | ||
{ | ||
name: "project:storybook:test-runner", | ||
files: [".storybook/test-runner-jest.js"], | ||
languageOptions: { | ||
globals: globals.commonjs, | ||
"react-hooks/exhaustive-deps": "off", | ||
}, | ||
}, | ||
// // Unit tests | ||
// { | ||
// files: ["**/*.spec.{js,jsx}", "src/vitest.setup.mjs"], | ||
// languageOptions: { | ||
// globals: { | ||
// ...globals.browser, | ||
// ...globals.vitest, | ||
// }, | ||
// }, | ||
// }, | ||
]; | ||
|
||
export default config; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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