@bopstack/oxlint-config 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 bop
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,44 @@
1
+ # @bopstack/oxlint-config
2
+
3
+ Shared oxlint configuration for @bopstack/\* projects.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ pnpm add -D @bopstack/oxlint-config @bopstack/oxc oxlint
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ Reference the config in your project's `oxlintrc.json`:
14
+
15
+ ```json
16
+ {
17
+ "extends": ["./node_modules/@bopstack/oxlint-config/oxlintrc.json"]
18
+ }
19
+ ```
20
+
21
+ Or copy the rules you need.
22
+
23
+ ## Companion packages
24
+
25
+ - `@bopstack/oxc` — provides custom oxlint JS plugin rules (`bopstack/no-inline-styles`, etc.)
26
+ - `oxlint` — the linter itself
27
+
28
+ See `peerDependencies` in `package.json` for required versions.
29
+
30
+ ## Release
31
+
32
+ Run the local verification gate before publishing:
33
+
34
+ ```bash
35
+ just check
36
+ just e2e
37
+ pnpm publish --dry-run
38
+ ```
39
+
40
+ Publish from `main` after the repository is tagged and pushed:
41
+
42
+ ```bash
43
+ pnpm publish --access public
44
+ ```
package/oxlintrc.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "$schema": "./node_modules/oxlint/configuration_schema.json",
3
+ "plugins": ["typescript", "unicorn", "import"],
4
+ "jsPlugins": [],
5
+ "env": {
6
+ "node": true,
7
+ "es2022": true
8
+ },
9
+ "rules": {
10
+ "eslint/curly": ["error", "all"],
11
+ "eqeqeq": "error",
12
+ "no-eval": "error",
13
+ "no-debugger": "error",
14
+ "no-console": "error",
15
+ "prefer-const": "error",
16
+ "prefer-optional-chain": "error",
17
+ "no-nested-ternary": "error",
18
+ "max-params": ["error", { "max": 3 }],
19
+ "unicorn/filename-case": ["error", { "case": "snakeCase" }],
20
+ "typescript/no-explicit-any": "error",
21
+ "typescript/no-unused-vars": "error",
22
+ "import/no-cycle": "error"
23
+ },
24
+ "overrides": [
25
+ {
26
+ "files": ["**/*.test.ts", "**/*.test.tsx", "**/*.spec.ts", "**/*.spec.tsx"],
27
+ "rules": {
28
+ "max-lines-per-function": "off",
29
+ "typescript/no-explicit-any": "off"
30
+ }
31
+ }
32
+ ],
33
+ "ignorePatterns": ["node_modules", "dist", "build", ".git", "*.d.ts"]
34
+ }
package/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "@bopstack/oxlint-config",
3
+ "version": "0.1.0",
4
+ "description": "Shared oxlint configuration for @bopstack/* projects",
5
+ "keywords": [
6
+ "bopstack",
7
+ "config",
8
+ "lint",
9
+ "oxc",
10
+ "oxlint"
11
+ ],
12
+ "homepage": "https://github.com/bopstack/oxlint#readme",
13
+ "bugs": {
14
+ "url": "https://github.com/bopstack/oxlint/issues"
15
+ },
16
+ "license": "MIT",
17
+ "author": "bop <brunodepaula.pro@gmail.com>",
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+ssh://git@github.com/bopstack/oxlint.git"
21
+ },
22
+ "files": [
23
+ "oxlintrc.json",
24
+ "src/"
25
+ ],
26
+ "type": "module",
27
+ "exports": {
28
+ "./oxlintrc.json": "./oxlintrc.json",
29
+ "./package.json": "./package.json"
30
+ },
31
+ "publishConfig": {
32
+ "access": "public"
33
+ },
34
+ "devDependencies": {
35
+ "arktype": "^2.2.0",
36
+ "oxfmt": "^0.52.0",
37
+ "oxlint": "^1.67.0",
38
+ "typescript": "^5.9.3",
39
+ "vitest": "^3.2.4"
40
+ },
41
+ "peerDependencies": {
42
+ "@bopstack/oxc": "^0.1.0",
43
+ "oxlint": "^1.67.0"
44
+ }
45
+ }
@@ -0,0 +1,58 @@
1
+ import { readFileSync } from 'node:fs'
2
+ import { join, dirname } from 'node:path'
3
+ import { fileURLToPath } from 'node:url'
4
+
5
+ import { type } from 'arktype'
6
+ import { describe, it, expect } from 'vitest'
7
+
8
+ const __dirname = dirname(fileURLToPath(import.meta.url))
9
+ const repoRoot = join(__dirname, '..')
10
+
11
+ const OxlintrcSchema = type({
12
+ plugins: 'string[]',
13
+ rules: {
14
+ 'no-console': "'error'",
15
+ 'typescript/no-explicit-any': "'error'",
16
+ 'import/no-cycle': "'error'"
17
+ }
18
+ })
19
+
20
+ describe('@bopstack/oxlint', () => {
21
+ it('oxlintrc.json has expected rule categories', () => {
22
+ const raw = JSON.parse(readFileSync(join(repoRoot, 'oxlintrc.json'), 'utf-8')) as Record<
23
+ string,
24
+ unknown
25
+ >
26
+ const result = OxlintrcSchema(raw)
27
+ if (result instanceof type.errors) {
28
+ throw new Error(`Validation failed: ${result.summary}`)
29
+ }
30
+ expect(result.plugins).toContain('typescript')
31
+ expect(result.plugins).toContain('unicorn')
32
+ expect(result.rules['no-console']).toBe('error')
33
+ expect(result.rules['import/no-cycle']).toBe('error')
34
+ })
35
+
36
+ it('has unicorn/filename-case rule', () => {
37
+ const raw = JSON.parse(readFileSync(join(repoRoot, 'oxlintrc.json'), 'utf-8')) as Record<
38
+ string,
39
+ unknown
40
+ >
41
+ const rules = raw.rules as Record<string, unknown>
42
+ expect(rules['unicorn/filename-case']).toBeDefined()
43
+ })
44
+
45
+ it('has test file overrides', () => {
46
+ const raw = JSON.parse(readFileSync(join(repoRoot, 'oxlintrc.json'), 'utf-8'))
47
+ expect(raw.overrides).toBeDefined()
48
+ expect(raw.overrides.length).toBeGreaterThanOrEqual(1)
49
+ expect(raw.overrides[0].files).toContain('**/*.test.ts')
50
+ })
51
+
52
+ it('has peerDependencies for oxlint and @bopstack/oxc', () => {
53
+ const pkg = JSON.parse(readFileSync(join(repoRoot, 'package.json'), 'utf-8'))
54
+ expect(pkg.peerDependencies).toBeDefined()
55
+ expect(pkg.peerDependencies.oxlint).toBeDefined()
56
+ expect(pkg.peerDependencies['@bopstack/oxc']).toBeDefined()
57
+ })
58
+ })
package/src/index.ts ADDED
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @bopstack/oxlint — shared oxlint configuration.
3
+ *
4
+ * Re-exports the package version as a runtime marker.
5
+ */
6
+
7
+ /** Package version. */
8
+ export const VERSION = '0.1.0' as const