Browse Source

ci: Update prettier to run on all js files in addition to ts (#67230)

We should always treat js,jsx,ts,tsx files the same in our codebase in
terms of linting/formatting/etc.

While there shouldn't be any jsx files, and the only js files would be
scripts or configs... in case things get added I want the tools to run
against them. Also, it simplifies things when trying to figure out what
tools are running if the globs are the same & comprehensive in all
places.
Ryan Albrecht 11 months ago
parent
commit
e0177902db

+ 3 - 0
.prettierignore

@@ -0,0 +1,3 @@
+**/tests/**/fixtures/**/*
+fixtures/**/*
+tests/relay_integration/**/*

+ 2 - 3
api-docs/index.ts

@@ -1,11 +1,10 @@
 /* global process */
 /* eslint-env node */
 /* eslint import/no-unresolved:0 */
-import fs from 'node:fs';
-import path from 'node:path';
-
 import yaml from 'js-yaml';
 import JsonRefs from 'json-refs';
+import fs from 'node:fs';
+import path from 'node:path';
 
 function dictToString(dict) {
   const res = [];

+ 2 - 3
api-docs/openapi-diff.ts

@@ -1,11 +1,10 @@
 /* eslint-env node */
 /* eslint import/no-unresolved:0 */
 
-import fs from 'node:fs';
-import https from 'node:https';
-
 import yaml from 'js-yaml';
 import jsonDiff from 'json-diff';
+import fs from 'node:fs';
+import https from 'node:https';
 
 async function main() {
   const openApiData = await new Promise((resolve, reject) =>

+ 0 - 1
api-docs/watch.ts

@@ -3,7 +3,6 @@
 import {spawn} from 'node:child_process';
 import {join} from 'node:path';
 import {stderr, stdout} from 'node:process';
-
 import sane from 'sane';
 
 const watcherPy = sane(join(__dirname, '../src/sentry'));

+ 0 - 1
build-utils/last-built-plugin.ts

@@ -2,7 +2,6 @@
 
 import fs from 'node:fs';
 import path from 'node:path';
-
 import type webpack from 'webpack';
 
 type Options = {

+ 0 - 1
config/webpack.chartcuterie.config.ts

@@ -2,7 +2,6 @@
 
 import childProcess from 'node:child_process';
 import path from 'node:path';
-
 import webpack from 'webpack';
 
 import baseConfig from '../webpack.config';

+ 5 - 3
package.json

@@ -226,11 +226,11 @@
     "lint:js": "eslint static/app tests/js --ext .js,.jsx,.ts,.tsx",
     "lint:css": "stylelint 'static/app/**/*.[jt]sx'",
     "lint:biome": "biome check .",
-    "lint:prettier": "prettier \"**/*.md\" \"**/*.yaml\" \"**/*.{ts,tsx}\" --check",
+    "lint:prettier": "prettier \"**/*.md\" \"**/*.yaml\" \"**/*.[jt]s(x)?\" --check",
     "fix": "yarn fix:biome && yarn fix:prettier && yarn fix:eslint",
     "fix:eslint": "eslint static/app tests/js --ext .js,.jsx,.ts,.tsx --fix",
     "fix:biome": "biome check . --apply",
-    "fix:prettier": "prettier \"**/*.md\" \"**/*.yaml\" \"**/*.{ts,tsx}\" --write",
+    "fix:prettier": "prettier \"**/*.md\" \"**/*.yaml\" \"**/*.[jt]s(x)?\" --write",
     "dev": "(yarn check --verify-tree || yarn install --check-files) && sentry devserver",
     "dev-ui": "SENTRY_UI_DEV_ONLY=1 SENTRY_WEBPACK_PROXY_PORT=7999 yarn webpack serve",
     "dev-acceptance": "NO_DEV_SERVER=1 NODE_ENV=development yarn webpack --watch",
@@ -265,7 +265,9 @@
       "last 3 iOS major versions",
       "Firefox ESR"
     ],
-    "test": ["current node"]
+    "test": [
+      "current node"
+    ]
   },
   "volta": {
     "extends": ".volta.json"