Skip to content

Commit

Permalink
Add TSConfig package
Browse files Browse the repository at this point in the history
  • Loading branch information
psirenny authored May 13, 2024
1 parent 5b141ac commit 626dc51
Show file tree
Hide file tree
Showing 28 changed files with 199 additions and 168 deletions.
5 changes: 5 additions & 0 deletions .changeset/mean-apes-yell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@spear-ai/tsconfig": major
---

Added TSConfig.
Binary file modified .yarn/install-state.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"husky": "9.0.11",
"npm-package-json-lint": "7.1.0",
"prettier": "3.2.5",
"turbo": "1.13.2",
"turbo": "1.13.3",
"typescript": "5.4.5"
},
"license": "MIT",
Expand Down
2 changes: 2 additions & 0 deletions packages/commitlint-config/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
.turbo
dist
node_modules
20 changes: 1 addition & 19 deletions packages/commitlint-config/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,6 @@
{
"compilerOptions": {
"declaration": true,
"esModuleInterop": true,
"experimentalDecorators": true,
"forceConsistentCasingInFileNames": true,
"module": "ESNext",
"moduleResolution": "Node",
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"outDir": "bin",
"pretty": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"sourceMap": true,
"strict": true,
"stripInternal": true,
"target": "ESNext"
},
"exclude": ["node_modules"],
"extends": "@spear-ai/tsconfig",
"include": [
"**/*.cjs",
"**/*.cts",
Expand All @@ -28,7 +11,6 @@
"**/*.mts",
"**/*.ts",
"**/*.tsx",
"<tsconfigRootDir>//README.md/1_1.js",
"types"
]
}
2 changes: 2 additions & 0 deletions packages/eslint-config/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
.turbo
dist
node_modules
14 changes: 7 additions & 7 deletions packages/eslint-config/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export const baseEslintConfig: Linter.FlatConfig[] = [
jsonc: jsoncPlugin as unknown as ESLint.Plugin,
},
rules: {
...(jsoncPlugin.configs.base.overrides[0].rules as Linter.RulesRecord),
...(jsoncPlugin.configs.base.overrides[0]?.rules as Linter.RulesRecord),
...(jsoncPlugin.configs["recommended-with-json"].rules as Linter.RulesRecord),
...jsonFamilyRules,
},
Expand All @@ -196,7 +196,7 @@ export const baseEslintConfig: Linter.FlatConfig[] = [
jsonc: jsoncPlugin as unknown as ESLint.Plugin,
},
rules: {
...(jsoncPlugin.configs.base.overrides[0].rules as Linter.RulesRecord),
...(jsoncPlugin.configs.base.overrides[0]?.rules as Linter.RulesRecord),
...(jsoncPlugin.configs["recommended-with-json5"].rules as Linter.RulesRecord),
...jsonFamilyRules,
},
Expand All @@ -211,7 +211,7 @@ export const baseEslintConfig: Linter.FlatConfig[] = [
jsonc: jsoncPlugin as unknown as ESLint.Plugin,
},
rules: {
...(jsoncPlugin.configs.base.overrides[0].rules as Linter.RulesRecord),
...(jsoncPlugin.configs.base.overrides[0]?.rules as Linter.RulesRecord),
...(jsoncPlugin.configs["recommended-with-jsonc"].rules as Linter.RulesRecord),
...jsonFamilyRules,
},
Expand All @@ -226,7 +226,7 @@ export const baseEslintConfig: Linter.FlatConfig[] = [
toml: tomlPlugin as ESLint.Plugin,
},
rules: {
...(tomlPlugin.configs.base.overrides[0].rules as Linter.RulesRecord),
...(tomlPlugin.configs.base.overrides[0]?.rules as Linter.RulesRecord),
...(tomlPlugin.configs.standard.rules as Linter.RulesRecord),
"no-multiple-empty-lines": ["error", { max: 1 }],
"no-trailing-spaces": ["error"],
Expand All @@ -243,7 +243,7 @@ export const baseEslintConfig: Linter.FlatConfig[] = [
yml: yamlPlugin as ESLint.Plugin,
},
rules: {
...(yamlPlugin.configs.base.overrides[0].rules as Linter.RulesRecord),
...(yamlPlugin.configs.base.overrides[0]?.rules as Linter.RulesRecord),
...(yamlPlugin.configs.standard.rules as Linter.RulesRecord),
"no-multiple-empty-lines": ["error", { max: 0 }],
"no-trailing-spaces": ["error"],
Expand Down Expand Up @@ -329,7 +329,7 @@ export const baseEslintConfig: Linter.FlatConfig[] = [
...airbnbTypescriptConfigShared.rules,
...airbnbTypescriptConfig.rules,
...(typescriptPlugin.configs?.base as ESLint.ConfigData).rules,
...(typescriptPlugin.configs?.["eslint-recommended"] as ESLint.ConfigData).overrides?.[0].rules,
...(typescriptPlugin.configs?.["eslint-recommended"] as ESLint.ConfigData).overrides?.[0]?.rules,
...(typescriptPlugin.configs?.["stylistic-type-checked"] as ESLint.ConfigData).rules,
...(typescriptPlugin.configs?.["strict-type-checked"] as ESLint.ConfigData).rules,
...(arrayFuncPlugin.configs?.recommended as ESLint.ConfigData).rules,
Expand Down Expand Up @@ -710,7 +710,7 @@ export const baseEslintConfig: Linter.FlatConfig[] = [
react: reactPlugin,
},
rules: {
...(markdownPlugin.configs?.recommended as ESLint.ConfigData).overrides?.[1].rules,
...(markdownPlugin.configs?.recommended as ESLint.ConfigData).overrides?.[1]?.rules,
"@typescript-eslint/no-unused-vars": ["off"],
"formatjs/no-literal-string-in-jsx": ["off"],
"import/no-default-export": ["off"],
Expand Down
20 changes: 1 addition & 19 deletions packages/eslint-config/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,6 @@
{
"compilerOptions": {
"declaration": true,
"esModuleInterop": true,
"experimentalDecorators": true,
"forceConsistentCasingInFileNames": true,
"module": "ESNext",
"moduleResolution": "Node",
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"outDir": "bin",
"pretty": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"sourceMap": true,
"strict": true,
"stripInternal": true,
"target": "ESNext"
},
"exclude": ["node_modules"],
"extends": "@spear-ai/tsconfig",
"include": [
"**/*.cjs",
"**/*.cts",
Expand All @@ -28,7 +11,6 @@
"**/*.mts",
"**/*.ts",
"**/*.tsx",
"<tsconfigRootDir>//README.md/1_1.js",
"types"
]
}
2 changes: 2 additions & 0 deletions packages/npm-package-json-lint-config/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
.turbo
dist
node_modules
19 changes: 1 addition & 18 deletions packages/npm-package-json-lint-config/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,6 @@
{
"compilerOptions": {
"declaration": true,
"esModuleInterop": true,
"experimentalDecorators": true,
"forceConsistentCasingInFileNames": true,
"module": "ESNext",
"moduleResolution": "Node",
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"outDir": "bin",
"pretty": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"sourceMap": true,
"strict": true,
"stripInternal": true,
"target": "ESNext"
},
"exclude": ["node_modules"],
"extends": "@spear-ai/tsconfig",
"include": [
"**/*.cjs",
"**/*.cts",
Expand Down
2 changes: 2 additions & 0 deletions packages/prettier-config/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
.turbo
dist
node_modules
20 changes: 1 addition & 19 deletions packages/prettier-config/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,6 @@
{
"compilerOptions": {
"declaration": true,
"esModuleInterop": true,
"experimentalDecorators": true,
"forceConsistentCasingInFileNames": true,
"module": "ESNext",
"moduleResolution": "Node",
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"outDir": "bin",
"pretty": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"sourceMap": true,
"strict": true,
"stripInternal": true,
"target": "ESNext"
},
"exclude": ["node_modules"],
"extends": "@spear-ai/tsconfig",
"include": [
"**/*.cjs",
"**/*.cts",
Expand All @@ -28,7 +11,6 @@
"**/*.mts",
"**/*.ts",
"**/*.tsx",
"<tsconfigRootDir>//README.md/1_1.js",
"types"
]
}
1 change: 1 addition & 0 deletions packages/pulumi-policy-pack/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.turbo
dist
node_modules
19 changes: 1 addition & 18 deletions packages/pulumi-policy-pack/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,6 @@
{
"compilerOptions": {
"declaration": true,
"esModuleInterop": true,
"experimentalDecorators": true,
"forceConsistentCasingInFileNames": true,
"module": "ESNext",
"moduleResolution": "Node",
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"outDir": "bin",
"pretty": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"sourceMap": true,
"strict": true,
"stripInternal": true,
"target": "ESNext"
},
"exclude": ["node_modules"],
"extends": "@spear-ai/tsconfig",
"include": [
"**/*.cjs",
"**/*.cts",
Expand Down
2 changes: 2 additions & 0 deletions packages/ruff-config/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.ruff_cache
.turbo
.venv
dist
node_modules
3 changes: 2 additions & 1 deletion packages/ruff-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"ruff-format:fix": "poetry run ruff format .",
"ruff-lint:check": "poetry run ruff check .",
"ruff-lint:fix": "poetry run ruff check --fix .",
"sync-version": "tsx sync-version"
"sync-version": "tsx sync-version",
"typescript:check": "tsc --noEmit"
}
}
20 changes: 1 addition & 19 deletions packages/ruff-config/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,12 @@
{
"compilerOptions": {
"declaration": true,
"esModuleInterop": true,
"experimentalDecorators": true,
"forceConsistentCasingInFileNames": true,
"module": "ESNext",
"moduleResolution": "Node",
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"outDir": "bin",
"pretty": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"sourceMap": true,
"strict": true,
"stripInternal": true,
"target": "ESNext"
},
"exclude": ["node_modules"],
"extends": "@spear-ai/tsconfig",
"include": [
"**/*.cjs",
"**/*.cts",
"**/*.js",
"**/*.jsx",
"**/*.jsx",
"<tsconfigRootDir>//README.md/1_1.js",
"**/*.mjs",
"**/*.mts",
"**/*.ts",
Expand Down
3 changes: 3 additions & 0 deletions packages/tsconfig/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.turbo
dist
node_modules
2 changes: 2 additions & 0 deletions packages/tsconfig/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist
node_modules
20 changes: 20 additions & 0 deletions packages/tsconfig/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# @spear-ai/tsconfig

A [TSConfig](https://www.typescriptlang.org/tsconfig) file.

## Installation

```shell
yarn add -DE @spear-ai/tsconfig
```

## Usage

Add the following to your `tsconfig.json` file:

```jsonc
{
"extends": "@spear-ai/tsconfig",
//
}
```
12 changes: 12 additions & 0 deletions packages/tsconfig/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { baseEslintConfig, prettierConfig } from "@spear-ai/eslint-config";

/** @type {import("eslint").Linter.FlatConfig} */
const eslintConfig = [
{
ignores: ["dist", "node_modules"],
},
...baseEslintConfig,
prettierConfig,
];

export default eslintConfig;
3 changes: 3 additions & 0 deletions packages/tsconfig/npmpackagejsonlint.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ["@spear-ai/npm-package-json-lint-config/spear-library"],
};
44 changes: 44 additions & 0 deletions packages/tsconfig/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"name": "@spear-ai/tsconfig",
"version": "3.1.1",
"description": "Spear AI TSConfig",
"author": {
"name": "Spear AI",
"email": "[email protected]",
"url": "https://spear.ai"
},
"type": "module",
"devDependencies": {
"@commitlint/types": "18.6.1",
"commitlint": "18.6.1",
"eslint": "8.57.0",
"npm-package-json-lint": "7.1.0",
"prettier": "3.2.5",
"turbo": "1.13.3",
"typescript": "5.4.5"
},
"files": [
"CHANGELOG.md",
"tsconfig.json"
],
"keywords": [
"TypeScript",
"config",
"TSConfig"
],
"license": "MIT",
"main": "tsconfig.json",
"repository": {
"type": "git",
"directory": "packages/tsconfig",
"url": "https://github.com/spear-ai/citizen.git"
},
"scripts": {
"eslint:check": "eslint --max-warnings 0 .",
"eslint:fix": "yarn eslint:check --fix",
"npmpkgjsonlint:check": "npmPkgJsonLint .",
"prettier:check": "prettier --check .",
"prettier:fix": "prettier --write .",
"typescript:check": "tsc --noEmit"
}
}
3 changes: 3 additions & 0 deletions packages/tsconfig/prettier.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const prettierConfig = require("@spear-ai/prettier-config");

module.exports = prettierConfig;
Loading

0 comments on commit 626dc51

Please sign in to comment.