Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
53 changes: 47 additions & 6 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,72 @@
import js from '@eslint/js';
import tseslint from 'typescript-eslint';
import prettier from 'eslint-config-prettier';
import globals from 'globals';
import { createRequire } from 'module';

const require = createRequire(import.meta.url);
const jestPlugin = require('eslint-plugin-jest');

export default tseslint.config(
js.configs.recommended,
...tseslint.configs.recommended,
prettier,
{
files: ['**/*.{js,mjs,cjs,ts,tsx,jsx}'],
plugins: {
jest: jestPlugin,
},
languageOptions: {
globals: {
...globals.browser,
...globals.node,
...globals.jest,
...globals.es2021,
'vi': 'readonly',
'spyOn': 'readonly',
},
},
},
{
ignores: [
'**/node_modules/',
'**/dist/',
'**/coverage/',
'**/package-lock.json',
'**/pnpm-lock.yaml'
'**/pnpm-lock.yaml',
'**/.next/',
'**/examples/'
]
},
{
rules: {
'@typescript-eslint/no-unused-vars': [
'error',
'warn',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' }
],
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/ban-ts-comment': 'warn',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-non-null-assertion': 'warn'
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-this-alias': 'off',
'@typescript-eslint/no-empty-object-type': 'off',
'@typescript-eslint/no-wrapper-object-types': 'off',
'@typescript-eslint/no-unsafe-function-type': 'off',
'no-undef': 'warn',
'no-unreachable': 'warn',
'no-unused-expressions': 'off',
'no-fallthrough': 'warn',
'no-redeclare': 'warn',
'no-setter-return': 'warn',
'no-irregular-whitespace': 'warn',
'camelcase': 'warn',
'jest/no-try-expect': 'off',
'jest/no-conditional-expect': 'off',
'@typescript-eslint/triple-slash-reference': 'off',
'@typescript-eslint/prefer-as-const': 'off'
}
}
);
);
42 changes: 42 additions & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# EXAMPLE USAGE:
#
# Refer for explanation to following link:
# https://lefthook.dev/configuration/
#
# pre-push:
# jobs:
# - name: packages audit
# tags:
# - frontend
# - security
# run: yarn audit
#
# - name: gems audit
# tags:
# - backend
# - security
# run: bundle audit
#
# pre-commit:
# parallel: true
# jobs:
# - run: yarn eslint {staged_files}
# glob: "*.{js,ts,jsx,tsx}"
#
# - name: rubocop
# glob: "*.rb"
# exclude:
# - config/application.rb
# - config/routes.rb
# run: bundle exec rubocop --force-exclusion {all_files}
#
# - name: govet
# files: git ls-files -m
# glob: "*.go"
# run: go vet {files}
#
# - script: "hello.js"
# runner: node
#
# - script: "hello.go"
# runner: go run
11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,20 @@
"devDependencies": {
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.27.1",
"@eslint/js": "^9.39.3",
"@types/node": "^20.11.0",
"@typescript-eslint/eslint-plugin": "^8.56.1",
"@typescript-eslint/parser": "^8.56.1",
"eslint": "^9.0.0",
"@eslint/js": "^9.0.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-jest": "^29.15.0",
"globals": "^16.5.0",
"husky": "^9.0.10",
"lint-staged": "^15.2.1",
"prettier": "^3.2.4",
"turbo": "^1.12.4",
"typescript-eslint": "^8.0.0",
"turbo": "^2.8.10",
"typescript": "^5.3.3",
"typescript-eslint": "^8.56.1",
"vitest": "^4.0.18"
},
"engines": {
Expand Down
11 changes: 11 additions & 0 deletions packages/critters/.changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
35 changes: 35 additions & 0 deletions packages/critters/.commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"extends": ["@commitlint/config-conventional"],
"rules": {
"type-enum": [
2,
"always",
[
"feat",
"fix",
"docs",
"style",
"refactor",
"perf",
"test",
"build",
"ci",
"chore",
"revert",
"deps"
]
],
"scope-enum": [
2,
"always",
[
"next-csrf",
"next-images",
"critters",
"repo",
"deps",
"release"
]
]
}
}
3 changes: 3 additions & 0 deletions packages/critters/.github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These are supported funding model platforms
github: [opensourceframework]
open_collective: opensourceframework
88 changes: 88 additions & 0 deletions packages/critters/.github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Bug Report
description: Report a bug in one of our packages
labels: ['needs-triage']
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to report this bug! Please fill out the sections below.

- type: dropdown
id: package
attributes:
label: Affected Package
description: Which package is affected?
options:
- '@opensourceframework/next-csrf'
- '@opensourceframework/next-images'
- '@opensourceframework/critters'
- Other
validations:
required: true

- type: textarea
id: description
attributes:
label: Bug Description
description: A clear description of what the bug is
validations:
required: true

- type: textarea
id: reproduction
attributes:
label: Reproduction Steps
description: Steps to reproduce the behavior
placeholder: |
1. Install package '...'
2. Configure with '...'
3. Run '...'
4. See error
validations:
required: true

- type: textarea
id: expected
attributes:
label: Expected Behavior
description: What did you expect to happen?
validations:
required: true

- type: textarea
id: actual
attributes:
label: Actual Behavior
description: What actually happened?
validations:
required: true

- type: input
id: version
attributes:
label: Package Version
placeholder: e.g., 1.0.0
validations:
required: true

- type: input
id: node-version
attributes:
label: Node.js Version
placeholder: e.g., 20.10.0
validations:
required: true

- type: input
id: os
attributes:
label: Operating System
placeholder: e.g., macOS 14, Windows 11, Ubuntu 22.04
validations:
required: true

- type: textarea
id: additional
attributes:
label: Additional Context
description: Add any other context, logs, or screenshots about the problem here
11 changes: 11 additions & 0 deletions packages/critters/.github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
blank_issues_enabled: false
contact_links:
- name: Documentation
url: https://github.com/opensourceframework/opensourceframework#readme
about: Check the documentation before opening an issue
- name: Discussions
url: https://github.com/opensourceframework/opensourceframework/discussions
about: Ask questions and discuss with the community
- name: Security Policy
url: https://github.com/opensourceframework/opensourceframework/security/policy
about: Report security vulnerabilities privately
45 changes: 45 additions & 0 deletions packages/critters/.github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Feature Request
description: Request a new feature for one of our packages
labels: ['enhancement', 'needs-triage']
body:
- type: dropdown
id: package
attributes:
label: Affected Package
description: Which package should this feature be added to?
options:
- '@opensourceframework/next-csrf'
- '@opensourceframework/next-images'
- '@opensourceframework/critters'
- New Package Suggestion
validations:
required: true

- type: textarea
id: problem
attributes:
label: Problem Statement
description: Is your feature request related to a problem? Please describe.
placeholder: I'm always frustrated when...
validations:
required: true

- type: textarea
id: solution
attributes:
label: Proposed Solution
description: Describe the solution you'd like to see
validations:
required: true

- type: textarea
id: alternatives
attributes:
label: Alternatives Considered
description: Describe any alternative solutions or features you've considered

- type: textarea
id: additional
attributes:
label: Additional Context
description: Add any other context or screenshots about the feature request here
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Security Vulnerability
description: Report a security vulnerability
labels: ['security']
body:
- type: markdown
attributes:
value: |
**Please do not report security vulnerabilities through public GitHub issues.**

Instead, please report them through GitHub Security Advisories.

Go to: Security > Report a vulnerability

Or visit: https://github.com/opensourceframework/opensourceframework/security/advisories/new
Loading
Loading