@workleap/eslint-configs 1.1.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @workleap/eslint-configs
|
|
2
2
|
|
|
3
|
+
## 1.1.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#327](https://github.com/workleap/wl-web-configs/pull/327) [`0853ee5`](https://github.com/workleap/wl-web-configs/commit/0853ee5fc10d33c4b209a4981947f0c52a759444) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Fine tuning ESLint rules.
|
|
8
|
+
|
|
9
|
+
## 1.1.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#325](https://github.com/workleap/wl-web-configs/pull/325) [`d99f038`](https://github.com/workleap/wl-web-configs/commit/d99f038ddb648cc345f60fca17e43f68e5434ddc) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Fine tuning ESLint rules.
|
|
14
|
+
|
|
3
15
|
## 1.1.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins/strictCssModulesNames.js","sources":["webpack://@workleap/eslint-configs/./src/plugins/strictCssModulesNames.ts"],"sourcesContent":["import type { Rule } from \"eslint\";\nimport type ESTree from \"estree\";\nimport { basename, parse, sep } from \"path\";\n\nexport const sanitizePath = (filePath: string) => {\n return filePath.replace(/\\//g, sep).trim();\n};\n\nexport const splitPath = (filePath: string) => {\n return sanitizePath(filePath).split(sep);\n};\n\nexport function getFilePath(context: Rule.RuleContext) {\n return sanitizePath(context.getFilename());\n}\n\nexport function getFileName(context: Rule.RuleContext) {\n return basename(getFilePath(context));\n}\n\nconst rule: Rule.RuleModule = {\n meta: {\n type: \"suggestion\",\n docs: {\n description: \"CSS Modules should have the same name as a component and located in the same folder\",\n category: \"Strict\",\n recommended: false,\n url: \"https://github.com/workleap/wl-web-configs/blob/main/packages/eslint-plugin/docs/rules/strict-css-modules-names.md\"\n }\n },\n create: function
|
|
1
|
+
{"version":3,"file":"plugins/strictCssModulesNames.js","sources":["webpack://@workleap/eslint-configs/./src/plugins/strictCssModulesNames.ts"],"sourcesContent":["import type { Rule } from \"eslint\";\nimport type ESTree from \"estree\";\nimport { basename, parse, sep } from \"path\";\n\nexport const sanitizePath = (filePath: string) => {\n return filePath.replace(/\\//g, sep).trim();\n};\n\nexport const splitPath = (filePath: string) => {\n return sanitizePath(filePath).split(sep);\n};\n\nexport function getFilePath(context: Rule.RuleContext) {\n return sanitizePath(context.getFilename());\n}\n\nexport function getFileName(context: Rule.RuleContext) {\n return basename(getFilePath(context));\n}\n\nconst rule: Rule.RuleModule = {\n meta: {\n type: \"suggestion\",\n docs: {\n description: \"CSS Modules should have the same name as a component and located in the same folder\",\n category: \"Strict\",\n recommended: false,\n url: \"https://github.com/workleap/wl-web-configs/blob/main/packages/eslint-plugin/docs/rules/strict-css-modules-names.md\"\n }\n },\n create: function(context) {\n const parsedPath = parse(getFileName(context));\n\n const getNodeSource = (node: ESTree.ImportDeclaration) => {\n return sanitizePath(node.source != null ? node.source.value as string : \"\");\n };\n\n const isCssModule = (source: string) => {\n return source.endsWith(\".module.css\");\n };\n\n const isStylesheetInSameFolder = (source: string) => {\n return splitPath(source).length <= 2; // ./myImage.svg\n };\n\n return {\n ImportDeclaration: function(node) {\n const importSource = getNodeSource(node);\n\n if (isCssModule(importSource)) {\n const validCssFilename = `${parsedPath.name}.module.css`;\n\n if (!isStylesheetInSameFolder(importSource)) {\n // ./myImage.svg\n context.report({\n node,\n message: `CSS Modules should be associated to one component and located in the same folder ./${validCssFilename}. If the module is already used by another component, create a new one.`\n });\n } else {\n const validCssPath = `.${sep}${validCssFilename}`;\n const isNamingValid = importSource === validCssPath;\n if (!isNamingValid) {\n context.report({\n node,\n message: `CSS Modules should be associated to one component and should be named ./${validCssFilename}. If the module is already used by another component, create a new one.`\n });\n }\n }\n }\n }\n };\n }\n};\n\nexport { rule as strictCssModulesNamesRule };\n"],"names":["basename","parse","sep","sanitizePath","filePath","splitPath","getFilePath","context","getFileName","rule","parsedPath","getNodeSource","node","isCssModule","source","isStylesheetInSameFolder","importSource","validCssFilename","validCssPath","isNamingValid","strictCssModulesNamesRule"],"mappings":";;;;;AAE4C;AAErC,MAAMG,eAAe,CAACC;IACzB,OAAOA,SAAS,OAAO,CAAC,OAAOF,GAAGA,EAAE,IAAI;AAC5C,EAAE;AAEK,MAAMG,YAAY,CAACD;IACtB,OAAOD,aAAaC,UAAU,KAAK,CAACF,GAAGA;AAC3C,EAAE;AAEK,SAASI,YAAYC,OAAyB;IACjD,OAAOJ,aAAaI,QAAQ,WAAW;AAC3C;AAEO,SAASC,YAAYD,OAAyB;IACjD,OAAOP,QAAQA,CAACM,YAAYC;AAChC;AAEA,MAAME,OAAwB;IAC1B,MAAM;QACF,MAAM;QACN,MAAM;YACF,aAAa;YACb,UAAU;YACV,aAAa;YACb,KAAK;QACT;IACJ;IACA,QAAQ,SAASF,OAAO;QACpB,MAAMG,aAAaT,KAAKA,CAACO,YAAYD;QAErC,MAAMI,gBAAgB,CAACC;YACnB,OAAOT,aAAaS,KAAK,MAAM,IAAI,OAAOA,KAAK,MAAM,CAAC,KAAK,GAAa;QAC5E;QAEA,MAAMC,cAAc,CAACC;YACjB,OAAOA,OAAO,QAAQ,CAAC;QAC3B;QAEA,MAAMC,2BAA2B,CAACD;YAC9B,OAAOT,UAAUS,QAAQ,MAAM,IAAI,GAAG,gBAAgB;QAC1D;QAEA,OAAO;YACH,mBAAmB,SAASF,IAAI;gBAC5B,MAAMI,eAAeL,cAAcC;gBAEnC,IAAIC,YAAYG,eAAe;oBAC3B,MAAMC,mBAAmB,GAAGP,WAAW,IAAI,CAAC,WAAW,CAAC;oBAExD,IAAI,CAACK,yBAAyBC,eAAe;wBACzC,gBAAgB;wBAChBT,QAAQ,MAAM,CAAC;4BACXK;4BACA,SAAS,CAAC,mFAAmF,EAAEK,iBAAiB,uEAAuE,CAAC;wBAC5L;oBACJ,OAAO;wBACH,MAAMC,eAAe,CAAC,CAAC,EAAEhB,GAAGA,GAAGe,kBAAkB;wBACjD,MAAME,gBAAgBH,iBAAiBE;wBACvC,IAAI,CAACC,eAAe;4BAChBZ,QAAQ,MAAM,CAAC;gCACXK;gCACA,SAAS,CAAC,wEAAwE,EAAEK,iBAAiB,uEAAuE,CAAC;4BACjL;wBACJ;oBACJ;gBACJ;YACJ;QACJ;IACJ;AACJ;AAE6C"}
|
package/dist/typescript.js
CHANGED
|
@@ -166,6 +166,15 @@ function defineTypeScriptConfig(tsconfigRootDir, options = {}) {
|
|
|
166
166
|
}
|
|
167
167
|
],
|
|
168
168
|
"@stylistic/operator-linebreak": "off",
|
|
169
|
+
"@stylistic/space-before-function-paren": [
|
|
170
|
+
"warn",
|
|
171
|
+
{
|
|
172
|
+
anonymous: "never",
|
|
173
|
+
named: "never",
|
|
174
|
+
asyncArrow: "always",
|
|
175
|
+
catch: "never"
|
|
176
|
+
}
|
|
177
|
+
],
|
|
169
178
|
"@stylistic/spaced-comment": "off",
|
|
170
179
|
// Should be the default but somehow it's not enforced if it's not explicitly specified.
|
|
171
180
|
"@stylistic/quote-props": "off",
|
package/dist/typescript.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescript.js","sources":["webpack://@workleap/eslint-configs/./src/typescript.ts"],"sourcesContent":["import js from \"@eslint/js\";\nimport stylisticPlugin from \"@stylistic/eslint-plugin\";\nimport type { Linter } from \"eslint\";\nimport tseslint from \"typescript-eslint\";\nimport type { ConfigWithExtends } from \"./types.ts\";\n\nexport interface TypeScriptConfigOptions {\n rules?: Partial<Linter.RulesRecord>;\n}\n\nexport const typescriptGlobalIgnores = [];\n\nexport function defineTypeScriptConfig(tsconfigRootDir: string, options: TypeScriptConfigOptions = {}) {\n const {\n rules = {}\n } = options;\n\n const config: ConfigWithExtends[] = [{\n name: \"@workleap/eslint-configs/typescript\",\n files: [\n \"**/*.{ts,tsx}\"\n ],\n plugins: {\n \"@stylistic\": stylisticPlugin\n },\n extends: [\n js.configs.recommended,\n tseslint.configs.recommendedTypeChecked,\n tseslint.configs.stylisticTypeCheckedOnly,\n stylisticPlugin.configs.customize({\n braceStyle: \"1tbs\",\n commaDangle: \"never\",\n jsx: false,\n quotes: \"double\",\n semi: true,\n severity: \"warn\"\n })\n ],\n languageOptions: {\n parser: tseslint.parser,\n parserOptions: {\n // Rely on TypeScript's project service to automatically discover the \"tsconfig.json\" file\n // within the boundaries of \"tsconfigRootDir\".\n projectService: true,\n tsconfigRootDir\n }\n },\n rules: {\n // ESLint core rules overrides\n \"dot-notation\": \"off\",\n \"indent\": \"off\",\n \"no-dupe-class-members\": \"off\",\n \"no-empty-function\": \"off\",\n \"no-loop-func\": \"off\",\n \"no-shadow\": \"off\",\n \"no-unused-expressions\": \"off\",\n \"no-use-before-define\": \"off\",\n \"no-useless-constructor\": \"off\",\n \"object-curly-spacing\": \"off\",\n \"quotes\": \"off\",\n \"semi\": \"off\",\n\n // ESlint deprecated core rules\n \"arrow-parens\": \"off\",\n \"comma-dangle\": \"off\",\n\n // @typescript-eslint recommended rules overrides\n \"@typescript-eslint/dot-notation\": \"off\",\n \"@typescript-eslint/no-base-to-string\": \"off\",\n \"@typescript-eslint/no-empty-function\": \"off\",\n \"@typescript-eslint/no-empty-object-type\": [\n \"error\",\n {\n allowInterfaces: \"with-single-extends\",\n allowObjectTypes: \"never\"\n }\n ],\n \"@typescript-eslint/no-floating-promises\": \"off\",\n // This rule should be enabled but has several options that need to be investigated.\n \"@typescript-eslint/no-misused-promises\": \"off\",\n \"@typescript-eslint/no-non-null-assertion\": \"off\",\n \"@typescript-eslint/no-unsafe-argument\": \"off\",\n \"@typescript-eslint/no-unsafe-assignment\": \"off\",\n \"@typescript-eslint/no-unsafe-call\": \"off\",\n \"@typescript-eslint/no-unsafe-member-access\": \"off\",\n \"@typescript-eslint/no-unsafe-return\": \"off\",\n \"@typescript-eslint/only-throw-error\": \"off\",\n \"@typescript-eslint/prefer-nullish-coalescing\": \"off\",\n \"@typescript-eslint/restrict-template-expressions\": \"off\",\n // This rule should be enabled but it's strangely causing issues with common React Aria patterns\n // when destructuring an object literal returned by a hook like \"useFilter\".\n \"@typescript-eslint/unbound-method\": \"off\",\n\n // @stylistic recommend rules overrides\n \"@stylistic/arrow-parens\": [\n \"warn\",\n \"as-needed\",\n {\n requireForBlockBody: false\n }\n ],\n \"@stylistic/indent\": [\n \"warn\",\n 4,\n {\n SwitchCase: 1,\n CallExpression: { arguments: \"first\" }\n }\n ],\n \"@stylistic/indent-binary-ops\": [\"warn\", 4],\n \"@stylistic/member-delimiter-style\": [\n \"warn\",\n {\n multiline: {\n delimiter: \"semi\"\n },\n singleline: {\n delimiter: \"semi\"\n }\n }\n ],\n \"@stylistic/multiline-ternary\": \"off\",\n \"@stylistic/no-mixed-operators\": [\n \"warn\",\n {\n groups: [\n [\"&\", \"|\", \"^\", \"~\", \"<<\", \">>\", \">>>\"],\n [\"==\", \"!=\", \"===\", \"!==\", \">\", \">=\", \"<\", \"<=\"],\n [\"&&\", \"||\"],\n [\"in\", \"instanceof\"]\n ],\n allowSamePrecedence: false\n }\n ],\n \"@stylistic/no-multiple-empty-lines\": [\n \"warn\",\n {\n // View https://eslint.style/rules/eol-last.\n max: 1\n }\n ],\n \"@stylistic/operator-linebreak\": \"off\",\n \"@stylistic/spaced-comment\": \"off\",\n // Should be the default but somehow it's not enforced if it's not explicitly specified.\n \"@stylistic/quote-props\": \"off\",\n\n // Positioned last to allow the consumer to override any rules.\n ...rules\n }\n }];\n\n return config;\n};\n"],"names":["js","stylisticPlugin","tseslint","typescriptGlobalIgnores","defineTypeScriptConfig","tsconfigRootDir","options","rules","config"],"mappings":";;;;;;;;;;;AAA4B;AAC2B;AAEd;AAOlC,MAAMG,0BAA0B,EAAE,CAAC;AAEnC,SAASC,u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,gBAAgB;4BAAE,WAAW;wBAAQ;oBACzC;iBACH;gBACD,gCAAgC;oBAAC;oBAAQ;iBAAE;gBAC3C,qCAAqC;oBACjC;oBACA;wBACI,WAAW;4BACP,WAAW;wBACf;wBACA,YAAY;4BACR,WAAW;wBACf;oBACJ;iBACH;gBACD,gCAAgC;gBAChC,iCAAiC;oBAC7B;oBACA;wBACI,QAAQ;4BACJ;gCAAC;gCAAK;gCAAK;gCAAK;gCAAK;gCAAM;gCAAM;6BAAM;4BACvC;gCAAC;gCAAM;gCAAM;gCAAO;gCAAO;gCAAK;gCAAM;gCAAK;6BAAK;4BAChD;gCAAC;gCAAM;6BAAK;4BACZ;gCAAC;gCAAM;6BAAa;yBACvB;wBACD,qBAAqB;oBACzB;iBACH;gBACD,sCAAsC;oBAClC;oBACA;wBACI,4CAA4C;wBAC5C,KAAK;oBACT;iBACH;gBACD,iCAAiC;gBACjC,6BAA6B;gBAC7B,wFAAwF;gBACxF,0BAA0B;gBAE1B,+DAA+D;gBAC/D,GAAGE,KAAK;YACZ;QACJ;KAAE;IAEF,OAAOC;AACX"}
|
|
1
|
+
{"version":3,"file":"typescript.js","sources":["webpack://@workleap/eslint-configs/./src/typescript.ts"],"sourcesContent":["import js from \"@eslint/js\";\nimport stylisticPlugin from \"@stylistic/eslint-plugin\";\nimport type { Linter } from \"eslint\";\nimport tseslint from \"typescript-eslint\";\nimport type { ConfigWithExtends } from \"./types.ts\";\n\nexport interface TypeScriptConfigOptions {\n rules?: Partial<Linter.RulesRecord>;\n}\n\nexport const typescriptGlobalIgnores = [];\n\nexport function defineTypeScriptConfig(tsconfigRootDir: string, options: TypeScriptConfigOptions = {}) {\n const {\n rules = {}\n } = options;\n\n const config: ConfigWithExtends[] = [{\n name: \"@workleap/eslint-configs/typescript\",\n files: [\n \"**/*.{ts,tsx}\"\n ],\n plugins: {\n \"@stylistic\": stylisticPlugin\n },\n extends: [\n js.configs.recommended,\n tseslint.configs.recommendedTypeChecked,\n tseslint.configs.stylisticTypeCheckedOnly,\n stylisticPlugin.configs.customize({\n braceStyle: \"1tbs\",\n commaDangle: \"never\",\n jsx: false,\n quotes: \"double\",\n semi: true,\n severity: \"warn\"\n })\n ],\n languageOptions: {\n parser: tseslint.parser,\n parserOptions: {\n // Rely on TypeScript's project service to automatically discover the \"tsconfig.json\" file\n // within the boundaries of \"tsconfigRootDir\".\n projectService: true,\n tsconfigRootDir\n }\n },\n rules: {\n // ESLint core rules overrides\n \"dot-notation\": \"off\",\n \"indent\": \"off\",\n \"no-dupe-class-members\": \"off\",\n \"no-empty-function\": \"off\",\n \"no-loop-func\": \"off\",\n \"no-shadow\": \"off\",\n \"no-unused-expressions\": \"off\",\n \"no-use-before-define\": \"off\",\n \"no-useless-constructor\": \"off\",\n \"object-curly-spacing\": \"off\",\n \"quotes\": \"off\",\n \"semi\": \"off\",\n\n // ESlint deprecated core rules\n \"arrow-parens\": \"off\",\n \"comma-dangle\": \"off\",\n\n // @typescript-eslint recommended rules overrides\n \"@typescript-eslint/dot-notation\": \"off\",\n \"@typescript-eslint/no-base-to-string\": \"off\",\n \"@typescript-eslint/no-empty-function\": \"off\",\n \"@typescript-eslint/no-empty-object-type\": [\n \"error\",\n {\n allowInterfaces: \"with-single-extends\",\n allowObjectTypes: \"never\"\n }\n ],\n \"@typescript-eslint/no-floating-promises\": \"off\",\n // This rule should be enabled but has several options that need to be investigated.\n \"@typescript-eslint/no-misused-promises\": \"off\",\n \"@typescript-eslint/no-non-null-assertion\": \"off\",\n \"@typescript-eslint/no-unsafe-argument\": \"off\",\n \"@typescript-eslint/no-unsafe-assignment\": \"off\",\n \"@typescript-eslint/no-unsafe-call\": \"off\",\n \"@typescript-eslint/no-unsafe-member-access\": \"off\",\n \"@typescript-eslint/no-unsafe-return\": \"off\",\n \"@typescript-eslint/only-throw-error\": \"off\",\n \"@typescript-eslint/prefer-nullish-coalescing\": \"off\",\n \"@typescript-eslint/restrict-template-expressions\": \"off\",\n // This rule should be enabled but it's strangely causing issues with common React Aria patterns\n // when destructuring an object literal returned by a hook like \"useFilter\".\n \"@typescript-eslint/unbound-method\": \"off\",\n\n // @stylistic recommend rules overrides\n \"@stylistic/arrow-parens\": [\n \"warn\",\n \"as-needed\",\n {\n requireForBlockBody: false\n }\n ],\n \"@stylistic/indent\": [\n \"warn\",\n 4,\n {\n SwitchCase: 1,\n CallExpression: { arguments: \"first\" }\n }\n ],\n \"@stylistic/indent-binary-ops\": [\"warn\", 4],\n \"@stylistic/member-delimiter-style\": [\n \"warn\",\n {\n multiline: {\n delimiter: \"semi\"\n },\n singleline: {\n delimiter: \"semi\"\n }\n }\n ],\n \"@stylistic/multiline-ternary\": \"off\",\n \"@stylistic/no-mixed-operators\": [\n \"warn\",\n {\n groups: [\n [\"&\", \"|\", \"^\", \"~\", \"<<\", \">>\", \">>>\"],\n [\"==\", \"!=\", \"===\", \"!==\", \">\", \">=\", \"<\", \"<=\"],\n [\"&&\", \"||\"],\n [\"in\", \"instanceof\"]\n ],\n allowSamePrecedence: false\n }\n ],\n \"@stylistic/no-multiple-empty-lines\": [\n \"warn\",\n {\n // View https://eslint.style/rules/eol-last.\n max: 1\n }\n ],\n \"@stylistic/operator-linebreak\": \"off\",\n \"@stylistic/space-before-function-paren\": [\n \"warn\",\n {\n anonymous: \"never\",\n named: \"never\",\n asyncArrow: \"always\",\n catch: \"never\"\n }\n ],\n \"@stylistic/spaced-comment\": \"off\",\n // Should be the default but somehow it's not enforced if it's not explicitly specified.\n \"@stylistic/quote-props\": \"off\",\n\n // Positioned last to allow the consumer to override any rules.\n ...rules\n }\n }];\n\n return config;\n};\n"],"names":["js","stylisticPlugin","tseslint","typescriptGlobalIgnores","defineTypeScriptConfig","tsconfigRootDir","options","rules","config"],"mappings":";;;;;;;;;;;AAA4B;AAC2B;AAEd;AAOlC,MAAMG,0BAA0B,EAAE,CAAC;AAEnC,SAASC,uBAAuBC,eAAuB,EAAEC,UAAmC,CAAC,CAAC;IACjG,MAAM,EACFC,QAAQ,CAAC,CA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iBAAE;gBAC3C,qCAAqC;oBACjC;oBACA;wBACI,WAAW;4BACP,WAAW;wBACf;wBACA,YAAY;4BACR,WAAW;wBACf;oBACJ;iBACH;gBACD,gCAAgC;gBAChC,iCAAiC;oBAC7B;oBACA;wBACI,QAAQ;4BACJ;gCAAC;gCAAK;gCAAK;gCAAK;gCAAK;gCAAM;gCAAM;6BAAM;4BACvC;gCAAC;gCAAM;gCAAM;gCAAO;gCAAO;gCAAK;gCAAM;gCAAK;6BAAK;4BAChD;gCAAC;gCAAM;6BAAK;4BACZ;gCAAC;gCAAM;6BAAa;yBACvB;wBACD,qBAAqB;oBACzB;iBACH;gBACD,sCAAsC;oBAClC;oBACA;wBACI,4CAA4C;wBAC5C,KAAK;oBACT;iBACH;gBACD,iCAAiC;gBACjC,0CAA0C;oBACtC;oBACA;wBACI,WAAW;wBACX,OAAO;wBACP,YAAY;wBACZ,OAAO;oBACX;iBACH;gBACD,6BAA6B;gBAC7B,wFAAwF;gBACxF,0BAA0B;gBAE1B,+DAA+D;gBAC/D,GAAGE,KAAK;YACZ;QACJ;KAAE;IAEF,OAAOC;AACX"}
|
package/package.json
CHANGED
|
@@ -28,7 +28,7 @@ const rule: Rule.RuleModule = {
|
|
|
28
28
|
url: "https://github.com/workleap/wl-web-configs/blob/main/packages/eslint-plugin/docs/rules/strict-css-modules-names.md"
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
|
-
create: function
|
|
31
|
+
create: function(context) {
|
|
32
32
|
const parsedPath = parse(getFileName(context));
|
|
33
33
|
|
|
34
34
|
const getNodeSource = (node: ESTree.ImportDeclaration) => {
|
|
@@ -44,7 +44,7 @@ const rule: Rule.RuleModule = {
|
|
|
44
44
|
};
|
|
45
45
|
|
|
46
46
|
return {
|
|
47
|
-
ImportDeclaration: function
|
|
47
|
+
ImportDeclaration: function(node) {
|
|
48
48
|
const importSource = getNodeSource(node);
|
|
49
49
|
|
|
50
50
|
if (isCssModule(importSource)) {
|
package/src/typescript.ts
CHANGED
|
@@ -140,6 +140,15 @@ export function defineTypeScriptConfig(tsconfigRootDir: string, options: TypeScr
|
|
|
140
140
|
}
|
|
141
141
|
],
|
|
142
142
|
"@stylistic/operator-linebreak": "off",
|
|
143
|
+
"@stylistic/space-before-function-paren": [
|
|
144
|
+
"warn",
|
|
145
|
+
{
|
|
146
|
+
anonymous: "never",
|
|
147
|
+
named: "never",
|
|
148
|
+
asyncArrow: "always",
|
|
149
|
+
catch: "never"
|
|
150
|
+
}
|
|
151
|
+
],
|
|
143
152
|
"@stylistic/spaced-comment": "off",
|
|
144
153
|
// Should be the default but somehow it's not enforced if it's not explicitly specified.
|
|
145
154
|
"@stylistic/quote-props": "off",
|