Skip to content

Commit ae37405

Browse files
committed
Merge branch 'develop'
2 parents 92797f1 + ca23e83 commit ae37405

File tree

98 files changed

+4732
-3416
lines changed

Some content is hidden

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

98 files changed

+4732
-3416
lines changed

.github/actions/prepare/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ runs:
1818
node-version: ${{ inputs.node-version }}
1919
cache: 'yarn'
2020
cache-dependency-path: ./yarn.lock
21+
check-latest: true
2122

2223
- name: Install dependencies on ${{ inputs.node-version }}
2324
run: yarn install

.github/workflows/tests.yml

Lines changed: 73 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ concurrency:
66
group: '${{ github.workflow }} - ${{ github.head_ref || github.ref }}'
77
cancel-in-progress: true
88

9-
defaults:
10-
run:
11-
shell: bash
12-
139
jobs:
1410
check-lint-and-formatting:
1511
name: Check lint and formatting with Node.js ${{ matrix.node-version }} on ${{ matrix.os }}
@@ -19,7 +15,7 @@ jobs:
1915
fail-fast: false
2016

2117
matrix:
22-
node-version: [22]
18+
node-version: [22, latest]
2319
os: [ubuntu-latest]
2420

2521
steps:
@@ -40,12 +36,33 @@ jobs:
4036
- name: Lint files
4137
run: yarn workspaces foreach -Ap -j unlimited run lint
4238

39+
test-types:
40+
name: Test types with TypeScript ${{ matrix.ts }} on ${{ matrix.os }} and Node.js ${{ matrix.node-version }}
41+
runs-on: ${{ matrix.os }}
42+
43+
strategy:
44+
fail-fast: false
45+
46+
matrix:
47+
node-version: [22, latest]
48+
os: [ubuntu-latest]
49+
ts: [5.3, 5.4, 5.5, 5.6, 5.7, 5.8]
50+
51+
steps:
52+
- name: Checkout repository
53+
uses: actions/checkout@v4
54+
55+
- name: Setup Node.js ${{ matrix.node-version }} and Install dependencies on ${{ matrix.os }}
56+
uses: ./.github/actions/prepare
57+
with:
58+
node-version: ${{ matrix.node-version }}
59+
60+
- name: Install TypeScript ${{ matrix.ts }}
61+
run: yarn up typescript@${{ matrix.ts }}
62+
4363
- name: Run type tests
4464
run: yarn workspaces foreach -Ap -j unlimited run test-types
4565

46-
- name: Run publint
47-
run: yarn workspaces foreach -Ap -j unlimited run check-package-json
48-
4966
build:
5067
name: Build ${{ matrix.package.name }} with Node.js ${{ matrix.node-version }} on ${{ matrix.os }}
5168
runs-on: ${{ matrix.os }}
@@ -55,7 +72,7 @@ jobs:
5572

5673
matrix:
5774
node-version: [18, 20, 22, latest]
58-
os: [ubuntu-latest, windows-latest]
75+
os: [ubuntu-latest, windows-latest, macos-latest]
5976
package:
6077
[
6178
{ directory: 'eslint', name: '@aryaemami59/eslint-config' },
@@ -106,7 +123,7 @@ jobs:
106123
{ directory: 'typescript', name: '@aryaemami59/tsconfig' },
107124
{ directory: 'vitest', name: '@aryaemami59/vitest-config' },
108125
]
109-
os: [ubuntu-latest, windows-latest]
126+
os: [ubuntu-latest, windows-latest, macos-latest]
110127

111128
steps:
112129
- name: Checkout repository
@@ -149,7 +166,7 @@ jobs:
149166
fail-fast: false
150167

151168
matrix:
152-
node-version: [22]
169+
node-version: [22, latest]
153170
package:
154171
[
155172
{ directory: 'eslint', name: '@aryaemami59/eslint-config' },
@@ -178,7 +195,51 @@ jobs:
178195
run: ls -l .
179196

180197
- name: Run are-the-types-wrong for ${{ matrix.package.name }} with Node.js ${{ matrix.node-version }} on ${{ matrix.os }}
181-
run: npx @arethetypeswrong/cli@latest packages/${{ matrix.package.directory }}/package.tgz --format table
198+
run: yarn attw packages/${{ matrix.package.directory }}/package.tgz --format table
199+
200+
- name: Did we fail?
201+
if: failure()
202+
run: ls -R
203+
204+
publint:
205+
name: Check if the package.json for ${{ matrix.package.name }} is correct with Node.js ${{ matrix.node-version }} on ${{ matrix.os }}
206+
runs-on: ${{ matrix.os }}
207+
needs: [build]
208+
209+
strategy:
210+
fail-fast: false
211+
212+
matrix:
213+
node-version: [22, latest]
214+
package:
215+
[
216+
{ directory: 'eslint', name: '@aryaemami59/eslint-config' },
217+
{ directory: 'prettier', name: '@aryaemami59/prettier-config' },
218+
{ directory: 'typescript', name: '@aryaemami59/tsconfig' },
219+
{ directory: 'vitest', name: '@aryaemami59/vitest-config' },
220+
]
221+
os: [ubuntu-latest]
222+
223+
steps:
224+
- name: Checkout repository
225+
uses: actions/checkout@v4
226+
227+
- name: Setup Node.js ${{ matrix.node-version }} and Install dependencies on ${{ matrix.os }}
228+
uses: ./.github/actions/prepare
229+
with:
230+
node-version: ${{ matrix.node-version }}
231+
232+
- name: Download build artifact for ${{ matrix.package.name }} with Node.js ${{ matrix.node-version }} on ${{ matrix.os }}
233+
uses: actions/download-artifact@v4
234+
with:
235+
name: ${{ matrix.package.directory }}-${{ matrix.node-version }}-${{ matrix.os }}
236+
path: packages/${{ matrix.package.directory }}
237+
238+
- name: Display folder structure
239+
run: ls -l .
240+
241+
- name: Run publint for ${{ matrix.package.name }} with Node.js ${{ matrix.node-version }} on ${{ matrix.os }}
242+
run: yarn packages/${{ matrix.package.directory }} run publint --strict ./package.tgz
182243

183244
- name: Did we fail?
184245
if: failure()

.gitignore

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,31 @@
11
.DS_Store
22
*.log
3-
node_modules
4-
dist
5-
6-
.yalc
3+
node_modules/
4+
dist/
5+
build/
6+
lib/
7+
.yalc/
78
yalc.lock
8-
yalc.sig
9-
109
.idea/
1110
.vscode/
1211
temp/
12+
.temp/
13+
.tmp/
1314
.tmp-projections
14-
build/
1515
.rts2*
1616
coverage/
17-
18-
.cache
17+
.cache/
1918
.yarnrc
2019
.yarn/*
21-
!.yarn/patches
22-
!.yarn/releases
23-
!.yarn/plugins
24-
!.yarn/sdks
25-
!.yarn/versions
20+
!.yarn/patches/
21+
!.yarn/releases/
22+
!.yarn/plugins/
23+
!.yarn/sdks/
24+
!.yarn/versions/
2625
.pnp.*
2726
*.tgz
28-
29-
tsconfig.vitest-temp.json
27+
tsconfig*.vitest-temp.json
28+
.vitest-reports/
3029
.eslintcache
30+
tsconfig*.tsbuildinfo
31+
.docusaurus/

.yarn/releases/yarn-4.5.1.cjs

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

.yarn/releases/yarn-4.9.1.cjs

Lines changed: 948 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ nmSelfReferences: false
66

77
nodeLinker: node-modules
88

9-
yarnPath: .yarn/releases/yarn-4.5.1.cjs
9+
yarnPath: .yarn/releases/yarn-4.9.1.cjs

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Configs
2+
3+
A collection of different configurations for different tools.
4+
5+
### What's Included
6+
7+
- [**ESLint**](./packages/eslint/README.md)
8+
- [**Prettier**](./packages/prettier/README.md)
9+
- [**TypeScript**](./packages/typescript/README.md)
10+
- [**Vitest**](./packages/vitest/README.md)

eslint.config.mjs

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
import { createESLintConfig } from '@aryaemami59/eslint-config'
2+
import vitestPlugin from '@vitest/eslint-plugin'
3+
import packageJson from './package.json' with { type: 'json' }
4+
5+
const eslintConfig = createESLintConfig([
6+
vitestPlugin.configs.recommended,
7+
vitestPlugin.configs.env,
28

3-
export default createESLintConfig([
49
{
5-
name: '@aryaemami59/overrides',
10+
name: `${packageJson.name}/overrides`,
611
languageOptions: {
712
parserOptions: {
813
projectService: {
@@ -17,5 +22,38 @@ export default createESLintConfig([
1722
},
1823
},
1924
},
25+
26+
rules: {
27+
'vitest/no-alias-methods': [2],
28+
'vitest/no-disabled-tests': [2],
29+
'vitest/no-focused-tests': [2],
30+
'vitest/no-test-prefixes': [2],
31+
'vitest/no-test-return-statement': [2],
32+
'vitest/prefer-comparison-matcher': [2],
33+
'vitest/prefer-describe-function-title': [2],
34+
'vitest/prefer-each': [2],
35+
'vitest/prefer-equality-matcher': [2],
36+
'vitest/prefer-expect-resolves': [2],
37+
'vitest/prefer-mock-promise-shorthand': [2],
38+
'vitest/prefer-spy-on': [2],
39+
'vitest/prefer-strict-boolean-matchers': [2],
40+
'vitest/prefer-strict-equal': [2],
41+
'vitest/prefer-to-be': [2],
42+
'vitest/prefer-to-contain': [2],
43+
'vitest/prefer-to-have-length': [2],
44+
'vitest/prefer-vi-mocked': [2],
45+
'vitest/require-mock-type-parameters': [
46+
2,
47+
{ checkImportFunctions: true },
48+
],
49+
},
50+
51+
settings: {
52+
vitest: {
53+
typecheck: true,
54+
},
55+
},
2056
},
2157
])
58+
59+
export default eslintConfig

examples/eslint/.gitignore

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,31 @@
11
.DS_Store
22
*.log
3-
node_modules
4-
dist
5-
6-
.yalc
3+
node_modules/
4+
dist/
5+
build/
6+
lib/
7+
.yalc/
78
yalc.lock
8-
yalc.sig
9-
109
.idea/
1110
.vscode/
1211
temp/
12+
.temp/
13+
.tmp/
1314
.tmp-projections
14-
build/
1515
.rts2*
1616
coverage/
17-
18-
.cache
17+
.cache/
1918
.yarnrc
20-
.yarn/*
21-
!.yarn/patches
22-
!.yarn/releases
23-
!.yarn/plugins
24-
!.yarn/sdks
25-
!.yarn/versions
19+
.yarn/
20+
!.yarn/patches/
21+
!.yarn/releases/
22+
!.yarn/plugins/
23+
!.yarn/sdks/
24+
!.yarn/versions/
2625
.pnp.*
2726
*.tgz
28-
29-
tsconfig.vitest-temp.json
27+
tsconfig*.vitest-temp.json
28+
.vitest-reports/
3029
.eslintcache
31-
32-
temp*/
30+
tsconfig*.tsbuildinfo
31+
.docusaurus/

examples/eslint/eslint.config.cjs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,24 @@
11
const { createESLintConfig } = require('@aryaemami59/eslint-config')
2+
const packageJson = require('./package.json')
3+
const path = require('node:path')
24

3-
module.exports = createESLintConfig([
5+
const basename = `${packageJson.name}/${path.extname(__filename).replace('.', '')}-config-file/overrides`
6+
7+
const eslintConfig = createESLintConfig([
8+
{
9+
ignores: ['!temp/'],
10+
name: `${basename}/global-ignores`,
11+
},
412
{
13+
name: `${basename}/main`,
514
rules: {
615
'no-console': [2],
716
},
817
},
918
{
19+
name: `${basename}/additional`,
1020
// ...Other additional overrides
1121
},
1222
])
23+
24+
module.exports = eslintConfig

0 commit comments

Comments
 (0)