-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updo, @eslint/json (not in main config yet) and vitest allowed reach
- Loading branch information
Showing
9 changed files
with
107 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,23 @@ | ||
import json from '@eslint/json' | ||
import type { ESLint, Linter } from 'eslint' | ||
import jsonc from 'eslint-plugin-jsonc' | ||
import jsoncParser from 'jsonc-eslint-parser' | ||
|
||
export const jsonConfig: Linter.FlatConfig = { | ||
ignores: ['.yarn/**', 'jest.config.cjs', '**/dist/**', 'dist', 'build/**', 'node_modules/**'], | ||
files: ['**/*.json', '**/*.jsonc', '**/*.json5'], | ||
plugins: { jsonc: jsonc as unknown as ESLint.Plugin }, | ||
languageOptions: { parser: jsoncParser }, | ||
rules: { | ||
...jsonc.configs['all'].rules, | ||
|
||
/// Support arrays with and without new lines but they can't mix | ||
'jsonc/array-element-newline': ['error', 'consistent'], | ||
|
||
'jsonc/auto': 'off', | ||
|
||
/// see https://ota-meshi.github.io/eslint-plugin-jsonc/rules/comma-dangle.html | ||
'jsonc/comma-dangle': ['error', 'only-multiline'], | ||
|
||
/// Indent with 2 spaces | ||
'jsonc/indent': ['error', 2, {}], | ||
|
||
/// Not all keys are camelCase | ||
'jsonc/key-name-casing': 'off', | ||
export const jsonConfig: Linter.Config = { | ||
files: ['**/*.json'], | ||
plugins: { json: json as unknown as ESLint.Plugin }, | ||
language: 'json/json', | ||
rules: { 'json/no-duplicate-keys': ['error'] }, | ||
} | ||
|
||
/// jsonc and json5 can have comments | ||
'jsonc/no-comments': 'off', | ||
export const jsoncConfig: Linter.Config = { | ||
files: ['**/*.jsonc'], | ||
plugins: { json: json as unknown as ESLint.Plugin }, | ||
language: 'json/jsonc', | ||
rules: { 'json/no-duplicate-keys': ['error'] }, | ||
} | ||
|
||
/// Don't sort keys. We want to keep the order of keys as they are: | ||
/// especially in arrays. | ||
'jsonc/sort-keys': 'off', | ||
}, | ||
export const json5Config: Linter.Config = { | ||
files: ['**/*.json5'], | ||
plugins: { json: json as unknown as ESLint.Plugin }, | ||
language: 'json/json5', | ||
rules: { 'json/no-duplicate-keys': ['error'] }, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { defineWorkspace } from 'vitest/config' | ||
|
||
export default defineWorkspace([ | ||
"./vitest.config.ts" | ||
'./vitest.config.ts', | ||
]) |
Oops, something went wrong.