@@ -11,9 +11,9 @@ import {
1111 disableTypeChecked ,
1212 strictTypeChecked ,
1313} from "@local/configs/eslint" ;
14- import { nullishComparison } from "@local/function-rules" ;
14+ import { nullishComparison , templateExpression } from "@local/function-rules" ;
1515import { recommended as fastImportRecommended } from "eslint-plugin-fast-import" ;
16- import functionRule from "eslint-plugin-function-rule" ;
16+ import { functionRule } from "eslint-plugin-function-rule" ;
1717import pluginVitest from "eslint-plugin-vitest" ;
1818import { defineConfig , globalIgnores } from "eslint/config" ;
1919import tseslint from "typescript-eslint" ;
@@ -26,8 +26,6 @@ const packagesTsConfigs = [
2626 "packages/*/*/tsconfig.json" ,
2727] ;
2828
29- const nullishComparisonRule = nullishComparison ( ) ;
30-
3129export default defineConfig ( [
3230 includeIgnoreFile ( gitignore , "Imported .gitignore patterns" ) as never ,
3331 globalIgnores ( [
@@ -55,21 +53,23 @@ export default defineConfig([
5553 } ,
5654 } ,
5755 plugins : {
58- "function-rule" : functionRule ( ( context ) => ( {
59- ...nullishComparisonRule ( context ) ,
60- TemplateLiteral ( node ) {
61- if ( node . loc ?. start . line !== node . loc ?. end . line ) {
62- context . report ( {
63- node,
64- message : "Avoid multiline template expressions." ,
65- } ) ;
66- }
67- } ,
68- } ) ) ,
56+ "nullish-comparison" : functionRule ( "v1" , nullishComparison ( ) ) ,
57+ "template-expression" : functionRule ( "v1" , templateExpression ( ) ) ,
58+ // "template-expression": functionRule("v1", (context) => ({
59+ // TemplateLiteral(node) {
60+ // if (node.loc?.start.line !== node.loc?.end.line) {
61+ // context.report({
62+ // node,
63+ // message: "Avoid multiline template expressions.",
64+ // });
65+ // }
66+ // },
67+ // })),
6968 } ,
7069 rules : {
7170 "fast-import/no-unused-exports" : "off" ,
72- "function-rule/function-rule" : "error" ,
71+ "nullish-comparison/v1" : "error" ,
72+ "template-expression/v1" : "warn" ,
7373 } ,
7474 } ,
7575 {
@@ -107,7 +107,8 @@ export default defineConfig([
107107 } ,
108108 rules : {
109109 "@typescript-eslint/no-empty-function" : [ "error" , { allow : [ "arrowFunctions" ] } ] ,
110- "function-rule/function-rule" : "off" ,
110+ "nullish-comparison/v1" : "off" ,
111+ "template-expression/v1" : "off" ,
111112 } ,
112113 } ,
113114 disableProblematicEslintJsRules ,
0 commit comments