Browse Source

configure biome for preset-templates package

Futa Arai 10 months ago
parent
commit
dbcfd92882

+ 0 - 1
biome.json

@@ -26,7 +26,6 @@
       "./packages/pdf-converter-client/**",
       "./packages/pdf-converter-client/**",
       "./packages/pluginkit/**",
       "./packages/pluginkit/**",
       "./packages/presentation/**",
       "./packages/presentation/**",
-      "./packages/preset-templates/**",
       "./packages/remark-attachment-refs/**",
       "./packages/remark-attachment-refs/**",
       "./packages/remark-drawio/**"
       "./packages/remark-drawio/**"
     ]
     ]

+ 1 - 0
packages/preset-templates/.eslintignore

@@ -0,0 +1 @@
+*

+ 0 - 5
packages/preset-templates/.eslintrc.js

@@ -1,5 +0,0 @@
-module.exports = {
-  extends: [
-    'plugin:vitest/recommended',
-  ],
-};

+ 2 - 1
packages/preset-templates/package.json

@@ -5,7 +5,8 @@
   "license": "MIT",
   "license": "MIT",
   "private": "true",
   "private": "true",
   "scripts": {
   "scripts": {
-    "test": "vitest run"
+    "test": "vitest run",
+    "lint": "biome check"
   },
   },
   "dependencies": {},
   "dependencies": {},
   "devDependencies": {
   "devDependencies": {

+ 7 - 8
packages/preset-templates/test/index.test.ts

@@ -1,13 +1,14 @@
 import path from 'node:path';
 import path from 'node:path';
 
 
-import { scanAllTemplates, validateTemplatePluginGrowiDirective, validateAllTemplateLocales } from '@growi/pluginkit/dist/v4/server';
-
+import {
+  scanAllTemplates,
+  validateAllTemplateLocales,
+  validateTemplatePluginGrowiDirective,
+} from '@growi/pluginkit/dist/v4/server';
 
 
 const projectDirRoot = path.resolve(__dirname, '../');
 const projectDirRoot = path.resolve(__dirname, '../');
 
 
-
 it('Validation for package.json should be passed', () => {
 it('Validation for package.json should be passed', () => {
-
   // when
   // when
   const caller = () => validateTemplatePluginGrowiDirective(projectDirRoot);
   const caller = () => validateTemplatePluginGrowiDirective(projectDirRoot);
 
 
@@ -16,7 +17,6 @@ it('Validation for package.json should be passed', () => {
 });
 });
 
 
 it('Validation for package.json should be return data', () => {
 it('Validation for package.json should be return data', () => {
-
   // when
   // when
   const data = validateTemplatePluginGrowiDirective(projectDirRoot);
   const data = validateTemplatePluginGrowiDirective(projectDirRoot);
 
 
@@ -24,7 +24,7 @@ it('Validation for package.json should be return data', () => {
   expect(data).not.toBeNull();
   expect(data).not.toBeNull();
 });
 });
 
 
-it('Scanning the templates ends up with no errors', async() => {
+it('Scanning the templates ends up with no errors', async () => {
   // when
   // when
   const results = await scanAllTemplates(projectDirRoot);
   const results = await scanAllTemplates(projectDirRoot);
 
 
@@ -32,8 +32,7 @@ it('Scanning the templates ends up with no errors', async() => {
   expect(results).not.toBeNull();
   expect(results).not.toBeNull();
 });
 });
 
 
-it('Scanning the templates ends up with no errors with opts.data', async() => {
-
+it('Scanning the templates ends up with no errors with opts.data', async () => {
   // setup
   // setup
   const data = validateTemplatePluginGrowiDirective(projectDirRoot);
   const data = validateTemplatePluginGrowiDirective(projectDirRoot);
 
 

+ 1 - 3
packages/preset-templates/tsconfig.json

@@ -3,8 +3,6 @@
   "compilerOptions": {
   "compilerOptions": {
     "esModuleInterop": true,
     "esModuleInterop": true,
     "resolveJsonModule": true,
     "resolveJsonModule": true,
-    "types": [
-      "vitest/globals"
-    ]
+    "types": ["vitest/globals"]
   }
   }
 }
 }