Skip to content

Instantly share code, notes, and snippets.

@demarchenac
Created February 19, 2025 01:43
Show Gist options
  • Save demarchenac/b09f7ce26043ee807af1354052e16b52 to your computer and use it in GitHub Desktop.
Save demarchenac/b09f7ce26043ee807af1354052e16b52 to your computer and use it in GitHub Desktop.
Next files
{
"semi": true,
"tabWidth": 2,
"useTabs": false,
"printWidth": 120,
"singleQuote": false,
"trailingComma": "es5",
"arrowParens": "always",
"jsxSingleQuote": false,
"plugins": ["prettier-plugin-tailwindcss"]
}
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit",
"source.addMissingImports": "explicit"
},
"prettier.semi": true,
"prettier.tabWidth": 2,
"prettier.useTabs": false,
"prettier.printWidth": 120,
"prettier.singleQuote": false,
"prettier.trailingComma": "es5",
"prettier.arrowParens": "always",
"prettier.jsxSingleQuote": false,
"prettier.enableDebugLogs": true,
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"files.exclude": {
"**/.git": true,
"**/.DS_Store": true,
"**/.vscode": true,
"**/.next": true,
"**/node_modules": true,
"next-env.d.ts": true
}
}
import { dirname } from "path";
import { fileURLToPath } from "url";
import { FlatCompat } from "@eslint/eslintrc";
import js from "@eslint/js";
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});
const eslintConfig = [
{
ignores: ["components/ui/**/*"],
},
...compat.extends("next/core-web-vitals", "next/typescript", "standard", "plugin:prettier/recommended", "prettier"),
{
rules: {
"import/order": [
"error",
{
groups: ["builtin", "external", "internal", ["parent", "sibling"], "index", "object"],
"newlines-between": "always",
pathGroups: [
{
pattern: "@app/**",
group: "external",
position: "after",
},
],
pathGroupsExcludedImportTypes: ["builtin"],
alphabetize: {
order: "asc",
caseInsensitive: true,
},
},
],
"comma-dangle": [
"error",
{
arrays: "always-multiline",
objects: "always-multiline",
imports: "always-multiline",
exports: "always-multiline",
functions: "never",
},
],
camelcase: "off",
},
},
{
files: ["**/*.ts", "**/*.tsx"],
rules: { "no-undef": "off" },
},
];
export default eslintConfig;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment