Skip to content

Commit

Permalink
Clean up prettier/eslint scripts (bluesky-social#1514)
Browse files Browse the repository at this point in the history
* add prettierignore, hoist script

* upgrade prettier

* bump prettier eslint deps

* format all files

* hoist prettier check

* remove unused scripts, hoist lint:fix

* remove npm-run-all, unused

* hoist lint

* remove lint scripts

* improve lint scripts

* remove prettierignores

* downgrade prettier deps to fix codgen

* reformat all files

* update makefile, format

* fix locklife

* final format

---------

Co-authored-by: dholms <[email protected]>
  • Loading branch information
estrattonbailey and dholms authored Sep 7, 2023
1 parent b3eb3d7 commit a7c42cf
Show file tree
Hide file tree
Showing 202 changed files with 1,816 additions and 2,161 deletions.
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
packages/api/src/client
packages/bsky/src/lexicon
packages/pds/src/lexicon
8 changes: 6 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"plugin:prettier/recommended",
"prettier"
],
"ignorePatterns":[
"ignorePatterns": [
"dist",
"node_modules",
"jest.config.base.js",
Expand All @@ -26,7 +26,11 @@
"rules": {
"no-var": "error",
"prefer-const": "warn",
"@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }],
"no-misleading-character-class": "warn",
"@typescript-eslint/no-unused-vars": [
"warn",
{ "argsIgnorePattern": "^_" }
],
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
Expand Down
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

**Describe the bug**

<!-- A clear and concise description of what the bug is. -->

**To Reproduce**
Expand All @@ -22,8 +22,8 @@ Steps to reproduce the behavior:

**Details**

- Operating system:
- Node version:
- Operating system:
- Node version:

**Additional context**

Expand Down
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ about: Suggest an idea for this project
title: ''
labels: feature-request
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 18
cache: "pnpm"
cache: 'pnpm'
- run: pnpm i --frozen-lockfile
- run: pnpm verify
- name: Publish
Expand All @@ -30,5 +30,5 @@ jobs:
with:
publish: pnpm release
version: pnpm version-packages
commit: "Version packages"
title: "Version packages"
commit: 'Version packages'
title: 'Version packages'
6 changes: 3 additions & 3 deletions .github/workflows/repo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 18
cache: "pnpm"
cache: 'pnpm'
- run: pnpm i --frozen-lockfile
- run: pnpm build
test:
Expand All @@ -38,7 +38,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 18
cache: "pnpm"
cache: 'pnpm'
- run: pnpm i --frozen-lockfile
- run: pnpm test:withFlags --maxWorkers=1 --shard=${{ matrix.shard }} --passWithNoTests
verify:
Expand All @@ -52,6 +52,6 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 18
cache: "pnpm"
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- run: pnpm verify
9 changes: 9 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
node_modules
dist
build
.nyc_output
coverage
pnpm-lock.yaml
.pnpm*
.changeset
*.d.ts
2 changes: 1 addition & 1 deletion CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ ATProto receives so many contributions that we could never list everyone who des

#### [TowhidKashem](https://github.com/TowhidKashem), Security disclosure, May 2023

#### [DavidBuchanan314](https://github.com/DavidBuchanan314), Security disclosure, May 2023
#### [DavidBuchanan314](https://github.com/DavidBuchanan314), Security disclosure, May 2023
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ lint: ## Run style checks and verify syntax

.PHONY: fmt
fmt: ## Run syntax re-formatting
pnpm prettier
pnpm format

.PHONY: deps
deps: ## Installs dependent libs using 'pnpm install'
Expand Down
4 changes: 2 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

## Reporting a Vulnerability

Please do NOT report possible security vulnerabilities in public channels such as GitHub Issues. If you believe you have found a security vulnerability, please email us at `[email protected]` with a description of the issue.
Please do NOT report possible security vulnerabilities in public channels such as GitHub Issues. If you believe you have found a security vulnerability, please email us at `[email protected]` with a description of the issue.

We will acknowledge the vulnerability as soon as possible - within 3 business days - and follow up when a fix lands. Please avoid discussing the vulnerability until we do so.

With your consent, we will add you to the repository [CONTRIBUTORS](https://github.com/bluesky-social/atproto/blob/main/CONTRIBUTORS.md) file.
With your consent, we will add you to the repository [CONTRIBUTORS](https://github.com/bluesky-social/atproto/blob/main/CONTRIBUTORS.md) file.
8 changes: 4 additions & 4 deletions jest.config.base.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Jest doesn't like ES modules, so we need to transpile them
// For each one, add them to this list, add them to
// For each one, add them to this list, add them to
// "workspaces.nohoist" in the root package.json, and
// make sure that a babel.config.js is in the package root
const esModules = ['get-port', 'node-fetch'].join('|')
Expand All @@ -8,12 +8,12 @@ const esModules = ['get-port', 'node-fetch'].join('|')
module.exports = {
roots: ['<rootDir>/src', '<rootDir>/tests'],
transform: {
"^.+\\.(t|j)s?$": "@swc/jest",
'^.+\\.(t|j)s?$': '@swc/jest',
},
transformIgnorePatterns: [`<rootDir>/node_modules/(?!${esModules})`],
testRegex: '(/tests/.*.(test|spec)).(jsx?|tsx?)$',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
setupFiles: ["<rootDir>/../../test-setup.ts"],
setupFiles: ['<rootDir>/../../test-setup.ts'],
verbose: true,
testTimeout: 60000
testTimeout: 60000,
}
64 changes: 33 additions & 31 deletions lexicons/app/bsky/actor/defs.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,27 @@
"type": "object",
"required": ["did", "handle"],
"properties": {
"did": {"type": "string", "format": "did"},
"handle": {"type": "string", "format": "handle"},
"did": { "type": "string", "format": "did" },
"handle": { "type": "string", "format": "handle" },
"displayName": {
"type": "string",
"maxGraphemes": 64,
"maxLength": 640
},
"avatar": { "type": "string" },
"viewer": {"type": "ref", "ref": "#viewerState"},
"viewer": { "type": "ref", "ref": "#viewerState" },
"labels": {
"type": "array",
"items": {"type": "ref", "ref": "com.atproto.label.defs#label"}
"items": { "type": "ref", "ref": "com.atproto.label.defs#label" }
}
}
},
"profileView": {
"type": "object",
"required": ["did", "handle"],
"properties": {
"did": {"type": "string", "format":"did"},
"handle": {"type": "string", "format":"handle"},
"did": { "type": "string", "format": "did" },
"handle": { "type": "string", "format": "handle" },
"displayName": {
"type": "string",
"maxGraphemes": 64,
Expand All @@ -39,20 +39,20 @@
"maxLength": 2560
},
"avatar": { "type": "string" },
"indexedAt": {"type": "string", "format": "datetime"},
"viewer": {"type": "ref", "ref": "#viewerState"},
"indexedAt": { "type": "string", "format": "datetime" },
"viewer": { "type": "ref", "ref": "#viewerState" },
"labels": {
"type": "array",
"items": {"type": "ref", "ref": "com.atproto.label.defs#label"}
"items": { "type": "ref", "ref": "com.atproto.label.defs#label" }
}
}
},
"profileViewDetailed": {
"type": "object",
"required": ["did", "handle"],
"properties": {
"did": {"type": "string", "format": "did"},
"handle": {"type": "string", "format": "handle"},
"did": { "type": "string", "format": "did" },
"handle": { "type": "string", "format": "handle" },
"displayName": {
"type": "string",
"maxGraphemes": 64,
Expand All @@ -65,52 +65,54 @@
},
"avatar": { "type": "string" },
"banner": { "type": "string" },
"followersCount": {"type": "integer"},
"followsCount": {"type": "integer"},
"postsCount": {"type": "integer"},
"indexedAt": {"type": "string", "format": "datetime"},
"viewer": {"type": "ref", "ref": "#viewerState"},
"followersCount": { "type": "integer" },
"followsCount": { "type": "integer" },
"postsCount": { "type": "integer" },
"indexedAt": { "type": "string", "format": "datetime" },
"viewer": { "type": "ref", "ref": "#viewerState" },
"labels": {
"type": "array",
"items": {"type": "ref", "ref": "com.atproto.label.defs#label"}
"items": { "type": "ref", "ref": "com.atproto.label.defs#label" }
}
}
},
"viewerState": {
"type": "object",
"properties": {
"muted": {"type": "boolean"},
"mutedByList": {"type": "ref", "ref": "app.bsky.graph.defs#listViewBasic"},
"blockedBy": {"type": "boolean"},
"blocking": {"type": "string", "format": "at-uri"},
"following": {"type": "string", "format": "at-uri"},
"followedBy": {"type": "string", "format": "at-uri"}
"muted": { "type": "boolean" },
"mutedByList": {
"type": "ref",
"ref": "app.bsky.graph.defs#listViewBasic"
},
"blockedBy": { "type": "boolean" },
"blocking": { "type": "string", "format": "at-uri" },
"following": { "type": "string", "format": "at-uri" },
"followedBy": { "type": "string", "format": "at-uri" }
}
},
"preferences": {
"type": "array",
"items": {
"type": "union",
"refs": [
"#adultContentPref",
"#contentLabelPref",
"#savedFeedsPref"
]
"refs": ["#adultContentPref", "#contentLabelPref", "#savedFeedsPref"]
}
},
"adultContentPref": {
"type": "object",
"required": ["enabled"],
"properties": {
"enabled": {"type": "boolean", "default": false}
"enabled": { "type": "boolean", "default": false }
}
},
"contentLabelPref": {
"type": "object",
"required": ["label", "visibility"],
"properties": {
"label": {"type": "string"},
"visibility": {"type": "string", "knownValues": ["show", "warn", "hide"]}
"label": { "type": "string" },
"visibility": {
"type": "string",
"knownValues": ["show", "warn", "hide"]
}
}
},
"savedFeedsPref": {
Expand Down
3 changes: 1 addition & 2 deletions lexicons/app/bsky/actor/getPreferences.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
"description": "Get private preferences attached to the account.",
"parameters": {
"type": "params",
"properties": {
}
"properties": {}
},
"output": {
"encoding": "application/json",
Expand Down
7 changes: 5 additions & 2 deletions lexicons/app/bsky/actor/getProfile.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@
"type": "params",
"required": ["actor"],
"properties": {
"actor": {"type": "string", "format": "at-identifier"}
"actor": { "type": "string", "format": "at-identifier" }
}
},
"output": {
"encoding": "application/json",
"schema": {"type": "ref", "ref": "app.bsky.actor.defs#profileViewDetailed"}
"schema": {
"type": "ref",
"ref": "app.bsky.actor.defs#profileViewDetailed"
}
}
}
}
Expand Down
7 changes: 5 additions & 2 deletions lexicons/app/bsky/actor/getProfiles.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"properties": {
"actors": {
"type": "array",
"items": {"type": "string", "format": "at-identifier"},
"items": { "type": "string", "format": "at-identifier" },
"maxLength": 25
}
}
Expand All @@ -23,7 +23,10 @@
"properties": {
"profiles": {
"type": "array",
"items": {"type": "ref", "ref": "app.bsky.actor.defs#profileViewDetailed"}
"items": {
"type": "ref",
"ref": "app.bsky.actor.defs#profileViewDetailed"
}
}
}
}
Expand Down
16 changes: 12 additions & 4 deletions lexicons/app/bsky/actor/getSuggestions.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@
"parameters": {
"type": "params",
"properties": {
"limit": {"type": "integer", "minimum": 1, "maximum": 100, "default": 50},
"cursor": {"type": "string"}
"limit": {
"type": "integer",
"minimum": 1,
"maximum": 100,
"default": 50
},
"cursor": { "type": "string" }
}
},
"output": {
Expand All @@ -18,10 +23,13 @@
"type": "object",
"required": ["actors"],
"properties": {
"cursor": {"type": "string"},
"cursor": { "type": "string" },
"actors": {
"type": "array",
"items": {"type": "ref", "ref": "app.bsky.actor.defs#profileView"}
"items": {
"type": "ref",
"ref": "app.bsky.actor.defs#profileView"
}
}
}
}
Expand Down
Loading

0 comments on commit a7c42cf

Please sign in to comment.