Skip to content

Commit c086da9

Browse files
authored
Merge pull request #9 from ScrapeGraphAI/js-eslint-prettier-configuration
Set up eslint and prettier for code linting and formatting
2 parents d5ce218 + 38e0862 commit c086da9

File tree

5 files changed

+52
-2
lines changed

5 files changed

+52
-2
lines changed

scrapegraph-js/.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/node_modules

scrapegraph-js/.prettierrc.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"semi": true,
3+
"singleQuote": true,
4+
"trailingComma": "es5",
5+
"tabWidth": 2,
6+
"useTabs": false,
7+
"printWidth": 110,
8+
"bracketSpacing": true,
9+
"arrowParens": "always",
10+
"quoteProps": "preserve"
11+
}

scrapegraph-js/eslint.config.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import globals from 'globals';
2+
import pluginJs from '@eslint/js';
3+
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
4+
5+
/** @type {import('eslint').Linter.Config[]} */
6+
export default [
7+
{ languageOptions: { globals: { ...globals.browser, ...globals.node } } },
8+
pluginJs.configs.recommended,
9+
eslintPluginPrettierRecommended,
10+
{ ignorePatterns: ['node_modules/'] },
11+
];

scrapegraph-js/package-lock.json

Lines changed: 18 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scrapegraph-js/package.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
"url": "https://github.com/ScrapeGraphAI/scrapegraph-sdk",
99
"directory": "scrapegraph-js"
1010
},
11+
"scripts": {
12+
"format": "prettier --write --cache --cache-strategy metadata . !dist",
13+
"lint": "eslint ."
14+
},
1115
"license": "MIT",
1216
"homepage": "https://github.com/ScrapeGraphAI/scrapegraph-sdk/tree/main/scrapegraph-js",
1317
"keywords": [
@@ -28,6 +32,12 @@
2832
"zod-to-json-schema": "^3.23.5"
2933
},
3034
"devDependencies": {
31-
"dotenv": "^16.4.5"
35+
"@eslint/js": "^9.16.0",
36+
"dotenv": "^16.4.5",
37+
"eslint": "^9.16.0",
38+
"eslint-config-prettier": "^9.1.0",
39+
"eslint-plugin-prettier": "^5.2.1",
40+
"globals": "^15.12.0",
41+
"prettier": "3.4.1"
3242
}
3343
}

0 commit comments

Comments
 (0)