Skip to content

Commit aee034f

Browse files
Layyzyypooloforal
andauthored
added prettier eslint setup (#4815)
* Add Prettier + ESLint configuration and CI integration * updated .eslintrc.json * updated .prettierignore --------- Co-authored-by: poolo <pooloforall@gmail.com>
1 parent 0a6b774 commit aee034f

File tree

6 files changed

+42
-6
lines changed

6 files changed

+42
-6
lines changed

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false

.eslintignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules/
2+
lib/
3+
dist/
4+
build/
5+
coverage/
6+
*.min.js

.eslintrc.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,16 @@
1313
"globalReturn": false
1414
}
1515
},
16-
"extends": ["eslint:recommended", "prettier"],
16+
"extends": ["eslint:recommended"],
1717
"ignorePatterns": ["lib/**"],
1818
"rules": {
1919
"no-console": "off",
20-
"no-mixed-spaces-and-tabs": "warn",
2120
"no-unused-vars": "off",
2221
"no-use-before-define": "off",
2322
"prefer-const": "off",
2423
"no-undef": "off",
2524
"no-redeclare": "off",
26-
"indent": ["warn", 4, { "SwitchCase": 1 }],
27-
"quotes": ["warn", "double", { "avoidEscape": true }],
2825
"semi": "error",
29-
"no-trailing-spaces": ["warn", { "skipBlankLines": true, "ignoreComments": true }],
3026
"no-duplicate-case": "error",
3127
"no-irregular-whitespace": "warn",
3228
"no-prototype-builtins" : "off",

.github/workflows/linter.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,17 @@ jobs:
3131
echo "EOF" >> $GITHUB_ENV
3232
3333
- name: Install dependencies
34-
run: npm install eslint
34+
run: npm install eslint prettier
3535

3636
- name: Run ESLint on changed files
3737
if: env.files != ''
3838
run: |
3939
echo "Linting the following files:"
4040
echo "$files"
4141
echo "$files" | xargs npx eslint
42+
- name: Run Prettier check on changed files
43+
if: env.files != ''
44+
run: |
45+
echo "Checking formatting for the following files:"
46+
echo "$files"
47+
echo "$files" | xargs npx prettier --check

.prettierignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules/
2+
lib/
3+
dist/
4+
build/
5+
*.min.js
6+
*.svg

.prettierrc

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

0 commit comments

Comments
 (0)