Skip to content

Commit c87b3a0

Browse files
authored
chore: format & lint (#1075)
1 parent c74be8e commit c87b3a0

66 files changed

Lines changed: 1455 additions & 1422 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.cjs

Lines changed: 56 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,62 @@
1-
'use strict';
1+
"use strict";
22

3-
const airbnbBase = require('eslint-config-airbnb-base');
3+
const airbnbBase = require("eslint-config-airbnb-base");
44

55
// eslint-disable-next-line import/no-dynamic-require
66
const bestPractices = require(airbnbBase.extends[0]);
77

88
const ignoredProps = bestPractices.rules[
9-
'no-param-reassign'
9+
"no-param-reassign"
1010
][1].ignorePropertyModificationsFor.concat(
11-
'err',
12-
'x',
13-
'_',
14-
'opts',
15-
'options',
16-
'settings',
17-
'config',
18-
'cfg',
11+
"err",
12+
"x",
13+
"_",
14+
"opts",
15+
"options",
16+
"settings",
17+
"config",
18+
"cfg"
1919
);
2020

2121
// Additional rules that are specific and overriding previous
2222
const additionalChanges = {
23-
strict: 'off',
23+
strict: "off",
2424

2525
// Enforce using named functions when regular function is used,
2626
// otherwise use arrow functions
27-
'func-names': ['error', 'always'],
27+
"func-names": ["error", "always"],
2828
// Always use parens (for consistency).
2929
// https://eslint.org/docs/rules/arrow-parens
30-
'arrow-parens': ['error', 'always', { requireForBlockBody: true }],
31-
'prefer-arrow-callback': [
32-
'error',
30+
"arrow-parens": ["error", "always", { requireForBlockBody: true }],
31+
"prefer-arrow-callback": [
32+
"error",
3333
{ allowNamedFunctions: true, allowUnboundThis: true },
3434
],
3535
// http://eslint.org/docs/rules/max-params
36-
'max-params': ['error', { max: 3 }],
36+
"max-params": ["error", { max: 3 }],
3737
// http://eslint.org/docs/rules/max-statements
38-
'max-statements': ['error', { max: 20 }],
38+
"max-statements": ["error", { max: 20 }],
3939
// http://eslint.org/docs/rules/max-statements-per-line
40-
'max-statements-per-line': ['error', { max: 1 }],
40+
"max-statements-per-line": ["error", { max: 1 }],
4141
// http://eslint.org/docs/rules/max-nested-callbacks
42-
'max-nested-callbacks': ['error', { max: 4 }],
42+
"max-nested-callbacks": ["error", { max: 4 }],
4343
// http://eslint.org/docs/rules/max-depth
44-
'max-depth': ['error', { max: 4 }],
44+
"max-depth": ["error", { max: 4 }],
4545
// enforces no braces where they can be omitted
4646
// https://eslint.org/docs/rules/arrow-body-style
4747
// Never enable for object literal.
48-
'arrow-body-style': [
49-
'error',
50-
'as-needed',
48+
"arrow-body-style": [
49+
"error",
50+
"as-needed",
5151
{ requireReturnForObjectLiteral: false },
5252
],
5353
// Allow functions to be use before define because:
5454
// 1) they are hoisted,
5555
// 2) because ensure read flow is from top to bottom
5656
// 3) logically order of the code.
5757
// 4) the only addition is 'typedefs' option, see overrides for TS files
58-
'no-use-before-define': [
59-
'error',
58+
"no-use-before-define": [
59+
"error",
6060
{
6161
functions: false,
6262
classes: true,
@@ -67,45 +67,45 @@ const additionalChanges = {
6767
// disallow reassignment of function parameters
6868
// disallow parameter object manipulation except for specific exclusions
6969
// rule: https://eslint.org/docs/rules/no-param-reassign.html
70-
'no-param-reassign': [
71-
'error',
70+
"no-param-reassign": [
71+
"error",
7272
{
7373
props: true,
7474
ignorePropertyModificationsFor: ignoredProps,
7575
},
7676
],
7777

7878
// disallow declaration of variables that are not used in the code
79-
'no-unused-vars': [
80-
'error',
79+
"no-unused-vars": [
80+
"error",
8181
{
8282
ignoreRestSiblings: true, // airbnb's default
83-
vars: 'all', // airbnb's default
84-
varsIgnorePattern: '^(?:$$|xx|_|__|[iI]gnor(?:e|ing|ed))',
85-
args: 'after-used', // airbnb's default
86-
argsIgnorePattern: '^(?:$$|xx|_|__|[iI]gnor(?:e|ing|ed))',
83+
vars: "all", // airbnb's default
84+
varsIgnorePattern: "^(?:$$|xx|_|__|[iI]gnor(?:e|ing|ed))",
85+
args: "after-used", // airbnb's default
86+
argsIgnorePattern: "^(?:$$|xx|_|__|[iI]gnor(?:e|ing|ed))",
8787

8888
// catch blocks are handled by Unicorns
89-
caughtErrors: 'none',
89+
caughtErrors: "none",
9090
// caughtErrorsIgnorePattern: '^(?:$$|xx|_|__|[iI]gnor(?:e|ing|ed))',
9191
},
9292
],
9393
};
9494

9595
const importRules = {
96-
'import/namespace': ['error', { allowComputed: true }],
97-
'import/no-absolute-path': 'error',
98-
'import/no-webpack-loader-syntax': 'error',
99-
'import/no-self-import': 'error',
96+
"import/namespace": ["error", { allowComputed: true }],
97+
"import/no-absolute-path": "error",
98+
"import/no-webpack-loader-syntax": "error",
99+
"import/no-self-import": "error",
100100

101101
// Enable this sometime in the future when Node.js has ES2015 module support
102102
// 'import/no-cycle': 'error',
103103

104104
// Disabled as it doesn't work with TypeScript
105105
// 'import/newline-after-import': 'error',
106106

107-
'import/no-amd': 'error',
108-
'import/no-duplicates': 'error',
107+
"import/no-amd": "error",
108+
"import/no-duplicates": "error",
109109

110110
// Enable this sometime in the future when Node.js has ES2015 module support
111111
// 'import/unambiguous': 'error',
@@ -116,10 +116,10 @@ const importRules = {
116116
// Looks useful, but too unstable at the moment
117117
// 'import/no-deprecated': 'error',
118118

119-
'import/no-extraneous-dependencies': 'off',
120-
'import/no-mutable-exports': 'error',
121-
'import/no-named-as-default-member': 'error',
122-
'import/no-named-as-default': 'error',
119+
"import/no-extraneous-dependencies": "off",
120+
"import/no-mutable-exports": "error",
121+
"import/no-named-as-default-member": "error",
122+
"import/no-named-as-default": "error",
123123

124124
// Disabled because it's buggy and it also doesn't work with TypeScript
125125
// 'import/no-unresolved': [
@@ -129,32 +129,32 @@ const importRules = {
129129
// }
130130
// ],
131131

132-
'import/order': 'error',
133-
'import/no-unassigned-import': [
134-
'error',
135-
{ allow: ['@babel/polyfill', '@babel/register'] },
132+
"import/order": "error",
133+
"import/no-unassigned-import": [
134+
"error",
135+
{ allow: ["@babel/polyfill", "@babel/register"] },
136136
],
137137

138-
'import/prefer-default-export': 'off',
138+
"import/prefer-default-export": "off",
139139

140140
// Ensure more web-compat
141141
// ! note that it doesn't work in CommonJS
142142
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/extensions.md
143-
'import/extensions': 'off',
143+
"import/extensions": "off",
144144

145145
// ? Always use named exports. Enable?
146146
// 'import/no-default-export': 'error',
147147

148148
// ? enable?
149-
'import/exports-last': 'off',
149+
"import/exports-last": "off",
150150

151151
// todo: Enable in future.
152152
// Ensures everything is tested (all exports should be used).
153153
// For cases when you don't want or can't test, add eslint-ignore comment!
154154
// see: https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-unused-modules.md
155-
'import/no-unused-modules': 'off',
155+
"import/no-unused-modules": "off",
156156

157-
'import/no-useless-path-segments': ['error', { noUselessIndex: false }],
157+
"import/no-useless-path-segments": ["error", { noUselessIndex: false }],
158158
};
159159

160160
module.exports = {
@@ -165,8 +165,8 @@ module.exports = {
165165
node: true,
166166
commonjs: true,
167167
},
168-
extends: ['eslint:recommended', 'airbnb-base', 'plugin:prettier/recommended'],
169-
plugins: ['prettier'],
168+
extends: ["eslint:recommended", "airbnb-base", "plugin:prettier/recommended"],
169+
plugins: ["prettier"],
170170
rules: {
171171
...additionalChanges,
172172
...importRules,

.github/dependabot.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
version: 2
44
updates:
5-
65
# Maintain dependencies for GitHub Actions
76
- package-ecosystem: "github-actions"
87
directory: "/"

.github/workflows/codeql-analysis.yml

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ name: "CodeQL"
1313

1414
on:
1515
push:
16-
branches: [ master ]
16+
branches: [master]
1717
pull_request:
1818
# The branches below must be a subset of the branches above
19-
branches: [ master ]
19+
branches: [master]
2020
schedule:
21-
- cron: '0 2 * * *'
21+
- cron: "0 2 * * *"
2222

2323
jobs:
2424
analyze:
@@ -32,39 +32,39 @@ jobs:
3232
strategy:
3333
fail-fast: false
3434
matrix:
35-
language: [ 'javascript' ]
35+
language: ["javascript"]
3636
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
3737
# Learn more about CodeQL language support at https://git.io/codeql-language-support
3838

3939
steps:
40-
- name: Checkout repository
41-
uses: actions/checkout@v5
40+
- name: Checkout repository
41+
uses: actions/checkout@v5
4242

43-
# Initializes the CodeQL tools for scanning.
44-
- name: Initialize CodeQL
45-
uses: github/codeql-action/init@v3
46-
with:
47-
languages: ${{ matrix.language }}
48-
# If you wish to specify custom queries, you can do so here or in a config file.
49-
# By default, queries listed here will override any specified in a config file.
50-
# Prefix the list here with "+" to use these queries and those in the config file.
51-
# queries: ./path/to/local/query, your-org/your-repo/queries@main
43+
# Initializes the CodeQL tools for scanning.
44+
- name: Initialize CodeQL
45+
uses: github/codeql-action/init@v3
46+
with:
47+
languages: ${{ matrix.language }}
48+
# If you wish to specify custom queries, you can do so here or in a config file.
49+
# By default, queries listed here will override any specified in a config file.
50+
# Prefix the list here with "+" to use these queries and those in the config file.
51+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
5252

53-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
54-
# If this step fails, then you should remove it and run the build manually (see below)
55-
- name: Autobuild
56-
uses: github/codeql-action/autobuild@v3
53+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
54+
# If this step fails, then you should remove it and run the build manually (see below)
55+
- name: Autobuild
56+
uses: github/codeql-action/autobuild@v3
5757

58-
# ℹ️ Command-line programs to run using the OS shell.
59-
# 📚 https://git.io/JvXDl
58+
# ℹ️ Command-line programs to run using the OS shell.
59+
# 📚 https://git.io/JvXDl
6060

61-
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
62-
# and modify them (or add more) to build your code if your project
63-
# uses a compiled language
61+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
62+
# and modify them (or add more) to build your code if your project
63+
# uses a compiled language
6464

65-
#- run: |
66-
# make bootstrap
67-
# make release
65+
#- run: |
66+
# make bootstrap
67+
# make release
6868

69-
- name: Perform CodeQL Analysis
70-
uses: github/codeql-action/analyze@v3
69+
- name: Perform CodeQL Analysis
70+
uses: github/codeql-action/analyze@v3

.github/workflows/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ name: ci
5252
on:
5353
push:
5454
branches:
55-
- '*'
55+
- "*"
5656
pull_request:
5757
branches:
58-
- '*'
58+
- "*"
5959

6060
jobs:
6161
build-and-test:
@@ -65,7 +65,7 @@ jobs:
6565
fail-fast: false
6666
matrix:
6767
os: [ubuntu-latest, macos-latest]
68-
node-version: [18, 20, 22, 'lts/*']
68+
node-version: [18, 20, 22, "lts/*"]
6969

7070
steps:
7171
- name: Checkout

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
!*.md*
99
!*.y*ml
1010

11+
pnpm-lock.yaml
12+
1113
!**/src
1214
!**/src/**
1315

.prettierrc.cjs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
"use strict";
2+
3+
const config = require("@tunnckocore/prettier-config");
4+
5+
module.exports = {
6+
...config,
7+
overrides: [
8+
{
9+
files: ["**/*.md*"],
10+
options: {
11+
proseWrap: "always",
12+
printWidth: 80,
13+
},
14+
},
15+
{
16+
files: ["**/.all-contributorsrc"],
17+
options: {
18+
parser: "json-stringify",
19+
singleQuote: false,
20+
},
21+
},
22+
],
23+
};

.prettierrc.js

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

0 commit comments

Comments
 (0)