Skip to content

Commit

Permalink
feat: support camel case file names
Browse files Browse the repository at this point in the history
  • Loading branch information
danielwaltz committed Dec 7, 2024
1 parent 8025acd commit ea01564
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/configs/unicorn.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import type { ResolvableFlatConfig } from "eslint-flat-config-utils";

export function unicornConfigs() {
return [
{
name: "danielwaltz/unicorn",
rules: {
"unicorn/filename-case": [
"error",
{
cases: { camelCase: true, kebabCase: true, pascalCase: true },
ignore: [/^[A-Z]+\..*$/, /import_map\.json/],
},
],
},
},
] as const satisfies ResolvableFlatConfig;
}
1 change: 1 addition & 0 deletions src/configs/vue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type { ResolvableFlatConfig } from "eslint-flat-config-utils";
export function vueConfigs() {
return [
{
name: "danielwaltz/vue",
files: ["**/*.vue"],
rules: {
"vue/block-lang": ["error", { script: { lang: ["ts", "tsx"] } }],
Expand Down
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { hasVue, sxzz } from "@sxzz/eslint-config";
import { unicornConfigs } from "./configs/unicorn.js";
import { vueConfigs } from "./configs/vue.js";
import { defineFlatConfigs } from "./utils.js";
import type { ResolvableFlatConfig } from "eslint-flat-config-utils";
Expand All @@ -11,6 +12,8 @@ export function danielwaltz(...userConfigs: ResolvableFlatConfig[]) {

composer.append(sxzz());

composer.append(unicornConfigs());

if (hasVue) composer.append(vueConfigs());

return composer;
Expand Down

0 comments on commit ea01564

Please sign in to comment.