Skip to content

Commit

Permalink
upd(lint): integrate eslint stylistic plugin with rules
Browse files Browse the repository at this point in the history
  • Loading branch information
blefnk committed Jan 3, 2024
1 parent 0764f6c commit 0b6b3fc
Show file tree
Hide file tree
Showing 13 changed files with 156 additions and 113 deletions.
1 change: 0 additions & 1 deletion .github/issue_template/2.feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,3 @@ body:
attributes:
label: Additional information
description: Add any other information related to the feature here. If your feature request is related to any issues or discussions, link them here.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Relivator 1.2.1: The Most Feature-Rich Next.js 14 Starter
# Relivator 1.2.2: The Most Feature-Rich Next.js 14 Starter

<!-- https://github.com/blefnk/relivator#readme -->

Expand Down
51 changes: 48 additions & 3 deletions eslint.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { FlatCompat } from "@eslint/eslintrc";
import eslintJsPlugin from "@eslint/js";
import importAliasPlugin from "@limegrass/eslint-plugin-import-alias";
import nextPlugin from "@next/eslint-plugin-next";
import stylisticPlugin from "@stylistic/eslint-plugin";
import tanstackQueryPlugin from "@tanstack/eslint-plugin-query";
import tsEslintPlugin from "@typescript-eslint/eslint-plugin";
import tsEslintParser from "@typescript-eslint/parser";
Expand Down Expand Up @@ -68,7 +69,7 @@ const compat = new FlatCompat();

export default antfu(
{
ignores: ["./.next", "./build", "./drizzle"],
ignores: [".next", "drizzle", "build"],
typescript: { tsconfigPath: "tsconfig.json" },
stylistic: { quotes: "double", semi: true },
settings: { react: { version: "detect" } },
Expand All @@ -86,6 +87,7 @@ export default antfu(
"@next/next": nextPlugin,
"promise": promisePlugin,
"unicorn": unicornPlugin,
"@stylistic": stylisticPlugin,
"functional": functionalPlugin,
"react-hooks": reactHooksPlugin,
"tailwindcss": tailwindcssPlugin,
Expand All @@ -97,6 +99,7 @@ export default antfu(
...promisePlugin.configs.recommended.rules,
...eslintJsPlugin.configs.recommended.rules,
...tailwindcssPlugin.configs.recommended.rules,
...stylisticPlugin.configs["recommended-flat"].rules,
...reactHooksPlugin.configs.recommended.rules,
...unicornPlugin.configs.recommended.rules,
...xssPlugin.configs.recommended.rules,
Expand All @@ -106,6 +109,49 @@ export default antfu(
...airbnbStyleConfig.rules,
...airbnbNodeConfig.rules,
...airbnbES6Config.rules,
// https://eslint.style/packages/default#rules
"max-len": "off",
"@stylistic/max-len": [
// https://eslint.style/rules/default/max-len
"error",
{
"code": 1000,
"ignoreComments": true,
"ignoreTrailingComments": true,
},
],
"@stylistic/max-statements-per-line": [
// https://eslint.style/rules/default/max-statements-per-line
"error",
{ "max": 1 },
],
"@stylistic/keyword-spacing": [
// https://eslint.style/rules/default/keyword-spacing
"error",
{ "before": true, "after": true },
],
"@stylistic/semi": "off",
"@stylistic/quotes": "off",
"@stylistic/indent": "off",
"@stylistic/quote-props": "off",
"@stylistic/operator-linebreak": "off",
"@stylistic/member-delimiter-style": "off",
"@stylistic/arrow-parens": "off",
"@stylistic/brace-style": "off",
"@stylistic/indent-binary-ops": "off",
"@stylistic/jsx-closing-tag-location": "off",
"@stylistic/jsx-curly-newline": "off",
"@stylistic/jsx-indent": "off",
"@stylistic/jsx-one-expression-per-line": "off",
"@stylistic/jsx-wrap-multilines": "off",
"@stylistic/multiline-ternary": "off",
"@stylistic/spaced-comment": "off",
"@stylistic/eol-last": "off",
"max-lines-per-function": ["error", 437],
"max-nested-callbacks": ["error", 4],
"max-statements": ["error", 76],
"max-params": ["error", 5],
"complexity": ["error", 63],
"computed-property-spacing": [
"off",
"never",
Expand Down Expand Up @@ -226,7 +272,6 @@ export default antfu(
"linebreak-style": "off",
"lines-around-directive": "off",
"lines-between-class-members": ["off", "always"],
"max-len": "off",
"new-cap": "off",
"new-parens": "off",
"no-alert": "off",
Expand Down Expand Up @@ -306,7 +351,7 @@ export default antfu(
"react/jsx-boolean-value": "off",
"react/jsx-curly-brace-presence": "off",
"react/jsx-fragments": "off",
"react/jsx-max-depth": ["off", { max: 5 }],
"react/jsx-max-depth": ["error", { max: 7 }],
"react/jsx-no-bind": "off",
"react/jsx-no-constructed-context-values": "off",
"react/jsx-no-leaked-render": ["off", { validStrategies: ["ternary"] }],
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@
"@limegrass/eslint-plugin-import-alias": "^1.1.0",
"@next/eslint-plugin-next": "^14.0.4",
"@playwright/test": "^1.40.1",
"@stylistic/eslint-plugin": "^1.5.3",
"@tailwindcss/typography": "^0.5.10",
"@tanstack/eslint-plugin-query": "^5.14.6",
"@testing-library/jest-dom": "^6.1.6",
Expand Down Expand Up @@ -343,10 +344,10 @@
"typescript": "5.3.3",
"xo": "^0.56.0"
},
"packageManager": "pnpm@8.13.1",
"packageManager": "pnpm@8.14.0",
"volta": {
"node": "20.10.0",
"pnpm": "8.13.1"
"pnpm": "8.14.0"
},
"pnpm": {
"overrides": {
Expand Down
Loading

0 comments on commit 0b6b3fc

Please sign in to comment.