Skip to content

Commit 4351302

Browse files
committed
Merge branch '@invertase/align-core' of https://github.com/firebase/firebaseui-web into @invertase/align-react
2 parents cfbbd10 + f63fc32 commit 4351302

File tree

65 files changed

+3754
-22874
lines changed

Some content is hidden

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

65 files changed

+3754
-22874
lines changed

.github/workflows/test.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,29 @@ on:
99
- "**"
1010

1111
jobs:
12+
lint:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
- name: Setup node
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: '20'
21+
check-latest: true
22+
- name: Setup pnpm
23+
uses: pnpm/action-setup@v4
24+
with:
25+
version: latest
26+
- name: Install dependencies
27+
run: pnpm install
28+
- name: Run ESLint on core packages
29+
run: pnpm --filter="@firebase-ui/*" run lint
30+
- name: Run ESLint on example apps
31+
run: pnpm --filter="angular-example" --filter="nextjs" --filter="react" run lint
32+
- name: Check Prettier formatting
33+
run: pnpm format:check
34+
1235
test:
1336
runs-on: ubuntu-latest
1437
steps:

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ dist-ssr
1515
# Angular
1616
.angular
1717

18+
# Next.js
19+
.next
20+
1821
# Coverage
1922
coverage
2023

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ releases/
1313
# Generated files
1414
*.min.js
1515
*.min.css
16+
packages/styles/dist.css
1617

1718
# Logs
1819
*.log

eslint.config.js

Lines changed: 95 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,47 +16,119 @@
1616

1717
import js from "@eslint/js";
1818
import prettier from "eslint-config-prettier";
19+
import tseslint from "@typescript-eslint/eslint-plugin";
20+
import tsparser from "@typescript-eslint/parser";
1921

2022
export default [
21-
{ ignores: ["**/dist/**", "**/node_modules/**", "**/releases/**", "**/.angular/**"] },
23+
{
24+
ignores: [
25+
"dist/**",
26+
"node_modules/**",
27+
"releases/**",
28+
"*.tgz",
29+
"**/dist/**",
30+
"**/node_modules/**",
31+
"**/build/**",
32+
"**/.next/**",
33+
"**/coverage/**",
34+
"**/.angular/**",
35+
"**/cache/**",
36+
"**/.cache/**",
37+
],
38+
},
2239
js.configs.recommended,
2340
prettier,
2441
{
25-
files: ["**/*.{js,jsx,ts,tsx}"],
42+
files: ["**/*.{js,jsx}"],
2643
languageOptions: {
2744
ecmaVersion: 2022,
2845
sourceType: "module",
46+
globals: {
47+
window: "readonly",
48+
console: "readonly",
49+
document: "readonly",
50+
process: "readonly",
51+
Buffer: "readonly",
52+
__dirname: "readonly",
53+
__filename: "readonly",
54+
global: "readonly",
55+
module: "readonly",
56+
require: "readonly",
57+
exports: "readonly",
58+
setImmediate: "readonly",
59+
clearImmediate: "readonly",
60+
URL: "readonly",
61+
clearInterval: "readonly",
62+
clearTimeout: "readonly",
63+
setTimeout: "readonly",
64+
setInterval: "readonly",
65+
},
66+
},
67+
rules: {
68+
"no-unused-vars": "off",
69+
"no-console": "warn",
70+
"prefer-const": "error",
71+
"no-var": "error",
72+
"no-undef": "off",
73+
},
74+
},
75+
{
76+
files: ["**/*.{ts,tsx}"],
77+
languageOptions: {
78+
ecmaVersion: 2022,
79+
sourceType: "module",
80+
parser: tsparser,
2981
parserOptions: {
3082
ecmaFeatures: {
3183
jsx: true,
3284
},
3385
},
86+
globals: {
87+
window: "readonly",
88+
console: "readonly",
89+
document: "readonly",
90+
process: "readonly",
91+
Buffer: "readonly",
92+
__dirname: "readonly",
93+
__filename: "readonly",
94+
global: "readonly",
95+
module: "readonly",
96+
require: "readonly",
97+
exports: "readonly",
98+
setImmediate: "readonly",
99+
clearImmediate: "readonly",
100+
URL: "readonly",
101+
clearInterval: "readonly",
102+
clearTimeout: "readonly",
103+
setTimeout: "readonly",
104+
setInterval: "readonly",
105+
React: "readonly",
106+
describe: "readonly",
107+
it: "readonly",
108+
expect: "readonly",
109+
beforeEach: "readonly",
110+
afterEach: "readonly",
111+
beforeAll: "readonly",
112+
afterAll: "readonly",
113+
vi: "readonly",
114+
test: "readonly",
115+
jest: "readonly",
116+
},
117+
},
118+
plugins: {
119+
"@typescript-eslint": tseslint,
34120
},
35121
rules: {
36-
// Core JavaScript rules
37-
"no-unused-vars": ["error", { varsIgnorePattern: "^_", argsIgnorePattern: "^_" }],
122+
"no-unused-vars": "off",
123+
"no-undef": "off",
38124
"no-console": "warn",
39125
"prefer-const": "error",
40126
"no-var": "error",
41-
42-
// Security and best practices
43-
"no-debugger": "error",
44-
"no-eval": "error",
45-
"no-implied-eval": "error",
46-
"no-new-func": "error",
47-
"no-script-url": "error",
48-
"no-with": "error",
49-
50-
// Modern JavaScript preferences
51-
"prefer-arrow-callback": "error",
52-
"prefer-template": "error",
53-
"prefer-destructuring": ["error", { object: true, array: false }],
54-
55-
// Code quality
56-
eqeqeq: ["error", "always"],
57-
"no-duplicate-imports": "error",
58-
"no-useless-return": "error",
59-
"no-useless-concat": "error",
127+
"@typescript-eslint/no-unused-vars": [
128+
"error",
129+
{ varsIgnorePattern: "^_", argsIgnorePattern: "^_", caughtErrorsIgnorePattern: "^_" },
130+
],
131+
"@typescript-eslint/no-explicit-any": "warn",
60132
},
61133
},
62134
];

examples/angular/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ This will compile your project and store the build artifacts in the `dist/` dire
3838

3939
## Running unit tests
4040

41-
To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
41+
To execute unit tests with [Vitest](https://vitest.dev), use the following command:
4242

4343
```bash
44-
ng test
44+
pnpm test
4545
```
4646

4747
## Running end-to-end tests

examples/angular/angular.json

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -69,21 +69,6 @@
6969
},
7070
"extract-i18n": {
7171
"builder": "@angular/build:extract-i18n"
72-
},
73-
"test": {
74-
"builder": "@angular/build:karma",
75-
"options": {
76-
"polyfills": ["zone.js", "zone.js/testing"],
77-
"tsConfig": "tsconfig.spec.json",
78-
"assets": [
79-
{
80-
"glob": "**/*",
81-
"input": "public"
82-
}
83-
],
84-
"styles": ["src/styles.css"],
85-
"scripts": []
86-
}
8772
}
8873
}
8974
},
@@ -107,13 +92,6 @@
10792
}
10893
},
10994
"defaultConfiguration": "production"
110-
},
111-
"test": {
112-
"builder": "@angular/build:karma",
113-
"options": {
114-
"tsConfig": "projects/angular/tsconfig.spec.json",
115-
"polyfills": ["zone.js", "zone.js/testing"]
116-
}
11795
}
11896
}
11997
}

examples/angular/eslint.config.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
import js from "@eslint/js";
1818
import prettier from "eslint-config-prettier";
19+
import typescript from "@typescript-eslint/eslint-plugin";
20+
import typescriptParser from "@typescript-eslint/parser";
1921

2022
export default [
2123
{ ignores: ["dist/**", "node_modules/**", ".angular/**"] },
@@ -26,13 +28,18 @@ export default [
2628
languageOptions: {
2729
ecmaVersion: 2022,
2830
sourceType: "module",
31+
parser: typescriptParser,
2932
parserOptions: {
3033
project: "./tsconfig.json",
3134
},
3235
},
36+
plugins: {
37+
"@typescript-eslint": typescript,
38+
},
3339
rules: {
34-
"no-unused-vars": ["error", { varsIgnorePattern: "^_", argsIgnorePattern: "^_" }],
35-
"no-console": "warn",
40+
"no-unused-vars": "off", // Use TypeScript version instead
41+
"no-console": "off", // Allow console in examples
42+
"no-undef": "off", // TypeScript handles this
3643
"prefer-const": "error",
3744
"no-var": "error",
3845
"@typescript-eslint/no-explicit-any": "warn",

0 commit comments

Comments
 (0)