Skip to content

Commit d8493fc

Browse files
committed
Replaced eslint and prettier with biome
1 parent ff0e8b8 commit d8493fc

26 files changed

+622
-727
lines changed

.eslintrc.js

Lines changed: 0 additions & 27 deletions
This file was deleted.

.prettierrc.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

biome.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/2.4.6/schema.json",
3+
"vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": true },
4+
"files": { "ignoreUnknown": false },
5+
"formatter": { "enabled": true, "indentStyle": "tab" },
6+
"linter": {
7+
"enabled": true,
8+
"rules": { "recommended": false },
9+
"includes": ["**", "!dist/**"]
10+
},
11+
"javascript": {
12+
"formatter": { "quoteStyle": "double" },
13+
"globals": ["exports"]
14+
},
15+
"assist": {
16+
"enabled": true,
17+
"actions": { "source": { "organizeImports": "on" } }
18+
}
19+
}

eslint.config.mjs

Lines changed: 0 additions & 29 deletions
This file was deleted.

index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// NPM Dependencies
2-
const to = require('to-case');
2+
const to = require("to-case");
33

44
// File Dependencies
5-
const { generateComponentFiles } = require('./lib');
5+
const { generateComponentFiles } = require("./lib");
66

77
/*
88
Generates the React component's files
@@ -14,7 +14,7 @@ const generateComponent = async (
1414
customCSS,
1515
customJSExtension,
1616
customCssExtension,
17-
nextjsSassSupport
17+
nextjsSassSupport,
1818
) => {
1919
const title = to.pascal(componentName);
2020
const folderName = to.slug(componentName);

lib/generators/component.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Dependencies
2-
const createFile = require('../helpers/createFile');
2+
const createFile = require("../helpers/createFile");
33

44
/**
55
* Defines the DOM to put inside of the React component, depending on the
@@ -32,13 +32,11 @@ const getFileContentForComponent = (
3232
folderName,
3333
customDOM,
3434
customCssExtension,
35-
nextjsSassSupport
35+
nextjsSassSupport,
3636
) => {
3737
const element = getDOM({ folderName, nextjsSassSupport, customDOM });
38-
const nextJsStylesVariable = nextjsSassSupport ? 'styles from ' : '';
39-
const fileExtension = nextjsSassSupport
40-
? 'module.scss'
41-
: customCssExtension;
38+
const nextJsStylesVariable = nextjsSassSupport ? "styles from " : "";
39+
const fileExtension = nextjsSassSupport ? "module.scss" : customCssExtension;
4240
const importStatement = `import ${nextJsStylesVariable}'./${title}.${fileExtension}';`;
4341
return fileContentTemplate({ importStatement, title, element });
4442
// The text template for the file content
@@ -56,14 +54,14 @@ const generateComponentFile = async ({
5654
customCssExtension,
5755
nextjsSassSupport,
5856
}) => {
59-
if (!customJSExtension) customJSExtension = 'js';
57+
if (!customJSExtension) customJSExtension = "js";
6058
const fileName = `${title}.${customJSExtension}`;
6159
const fileContent = getFileContentForComponent(
6260
title,
6361
folderName,
6462
customDOM,
6563
customCssExtension,
66-
nextjsSassSupport
64+
nextjsSassSupport,
6765
);
6866
return await createFile(folderPath, fileName, fileContent);
6967
};

lib/generators/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
const {
33
getFileContentForComponent,
44
generateComponentFile,
5-
} = require('./component');
6-
const { getFileContentForStyleFile, generateStyleFile } = require('./style');
7-
const { getFileContentForTestFile, generateTestFile } = require('./test');
5+
} = require("./component");
6+
const { getFileContentForStyleFile, generateStyleFile } = require("./style");
7+
const { getFileContentForTestFile, generateTestFile } = require("./test");
88

99
module.exports = {
1010
getFileContentForComponent,

lib/generators/style.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// Dependencies
2-
const createFile = require('../helpers/createFile');
2+
const createFile = require("../helpers/createFile");
33

44
/*
55
Generates the file content for the Styling file
66
*/
77
const getFileContentForStyleFile = (title, customCSS) => {
8-
const css = customCSS || '// TODO - put styling information here';
8+
const css = customCSS || "// TODO - put styling information here";
99
return `
1010
#${title} {
1111
${css}
@@ -24,7 +24,7 @@ const generateStyleFile = async ({
2424
nextjsSassSupport,
2525
}) => {
2626
const fileName = `${title}.${
27-
nextjsSassSupport ? 'module.scss' : customCssExtension || 'scss'
27+
nextjsSassSupport ? "module.scss" : customCssExtension || "scss"
2828
}`;
2929
const fileContent = getFileContentForStyleFile(folderName, customCSS);
3030
return await createFile(folderPath, fileName, fileContent);

lib/generators/test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Dependencies
2-
const createFile = require('../helpers/createFile');
2+
const createFile = require("../helpers/createFile");
33

44
/*
55
Generates the file content for the test file
@@ -18,7 +18,7 @@ describe('${title}', () => {
1818
Generates the test file
1919
*/
2020
const generateTestFile = async ({ title, folderPath, customJSExtension }) => {
21-
if (!customJSExtension) customJSExtension = 'js';
21+
if (!customJSExtension) customJSExtension = "js";
2222
const fileName = `${title}.test.${customJSExtension}`;
2323
const fileContent = getFileContentForTestFile(title);
2424
return await createFile(folderPath, fileName, fileContent);

lib/helpers/createFile.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// NPM Dependencies
2-
const util = require('util');
3-
const path = require('path');
4-
const fs = require('fs');
2+
const util = require("util");
3+
const path = require("path");
4+
const fs = require("fs");
55

66
// Promisified functions
77
const writeFile = util.promisify(fs.writeFile);

0 commit comments

Comments
 (0)