Skip to content

Commit

Permalink
use @nuxt/eslint-config
Browse files Browse the repository at this point in the history
  • Loading branch information
JDIZM committed Jul 11, 2024
1 parent e8687bb commit d460d98
Show file tree
Hide file tree
Showing 10 changed files with 1,389 additions and 952 deletions.
2 changes: 1 addition & 1 deletion apps/nitro/server/middleware/auth.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default defineEventHandler((event) => {
// Extends or modify the event
event.context.user = { name: 'Nitro' }
event.context.user = { name: "Nitro" }
})
2 changes: 1 addition & 1 deletion apps/nitro/server/middleware/log.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default defineEventHandler((event) => {
// eslint-disable-next-line no-console
console.log(`New request: ${getRequestURL(event)}`);
console.log(`New request: ${getRequestURL(event)}`)
})
6 changes: 3 additions & 3 deletions apps/nitro/server/routes/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default eventHandler((event) => {
// eslint-disable-next-line no-console
console.log(`New request: ${getRequestURL(event)}`);
return "Start by editing <code>server/routes/index.ts</code>.";
});
console.log(`New request: ${getRequestURL(event)}`)
return "Start by editing <code>server/routes/index.ts</code>."
})
4 changes: 2 additions & 2 deletions apps/nitro/server/routes/user/index.get.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default eventHandler((event) => {
// eslint-disable-next-line no-console
console.log(`New request: ${getRequestURL(event)}`);
return 'User GET'
console.log(`New request: ${getRequestURL(event)}`)
return "User GET"
})
1 change: 0 additions & 1 deletion apps/nuxt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
},
"devDependencies": {
"@nuxt/devtools": "latest",
"@nuxtjs/eslint-config-typescript": "^12.1.0",
"@nuxtjs/tailwindcss": "^6.8.1",
"@pinia/testing": "^0.1.3",
"@testing-library/vue": "^8.0.1",
Expand Down
22 changes: 11 additions & 11 deletions packages/eslint-config-custom/nitro.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { resolve } = require("node:path");
const project = resolve(process.cwd(), "tsconfig.json");
const { resolve } = require("node:path")
const project = resolve(process.cwd(), "tsconfig.json")

/*
* This is a custom ESLint configuration for use with
Expand All @@ -11,28 +11,28 @@ const project = resolve(process.cwd(), "tsconfig.json");
*/
module.exports = {
extends: [
"@nuxtjs/eslint-config-typescript",
"@nuxt/eslint-config",
"@vercel/style-guide/eslint/node",
"@vercel/style-guide/eslint/browser",
"eslint-config-turbo",
"eslint-config-turbo"
].map(require.resolve),
parserOptions: {
sourceType: "module",
sourceType: "module"
},
settings: {
"import/resolver": {
typescript: {
project,
},
},
project
}
}
},
ignorePatterns: ["node_modules/", "dist/", ".eslintrc.cjs", "nitro.config.ts"],
rules: {
"comma-dangle": "off",
semi: "off",
"no-undef": "off",
"import/no-default-export": "off",
"eslint-comments/require-description": "off",
"eslint-comments/require-description": "off"
// add specific rules configurations here
},
};
}
}
2 changes: 1 addition & 1 deletion packages/eslint-config-custom/nuxt.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const project = resolve(process.cwd(), "tsconfig.json")
*/
module.exports = {
extends: [
"@nuxtjs/eslint-config-typescript",
"@nuxt/eslint-config",
"@vercel/style-guide/eslint/node",
"@vercel/style-guide/eslint/browser",
"eslint-config-turbo"
Expand Down
10 changes: 5 additions & 5 deletions packages/eslint-config-custom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
"version": "0.0.0",
"private": true,
"devDependencies": {
"@nuxtjs/eslint-config-typescript": "^12.1.0",
"@vercel/style-guide": "^5.2.0",
"@vue/eslint-config-typescript": "^12.0.0",
"eslint-config-turbo": "^2.0.0",
"typescript": "^5.3.3"
"@nuxt/eslint-config": "^0.3.13",
"@vercel/style-guide": "^6.0.0",
"@vue/eslint-config-typescript": "^13.0.0",
"eslint-config-turbo": "^2.0.6",
"typescript": "^5.5.3"
}
}
10 changes: 2 additions & 8 deletions packages/eslint-config-custom/vue.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,7 @@ module.exports = {
rules: {
"import/no-default-export": "off",
"vue/multi-word-component-names": "off",
"eslint-comments/require-description": "off"
// "unicorn/filename-case": [
// "error",
// {
// case: "kebabCase"
// }
// ]
// add specific rules configurations here
"eslint-comments/require-description": "off",
"unicorn/filename-case": "error"
}
}
Loading

0 comments on commit d460d98

Please sign in to comment.