Skip to content

Commit

Permalink
chore: formatting with prettier (#3527)
Browse files Browse the repository at this point in the history
This switches from standardjs to prettier for styling.
  • Loading branch information
trentm authored Jul 31, 2023
1 parent 0f2273e commit 701f820
Show file tree
Hide file tree
Showing 491 changed files with 51,605 additions and 39,805 deletions.
89 changes: 77 additions & 12 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,88 @@
// `npx eslint --print-config index.js` to print calculated config.
{
"root": true,
"parserOptions": {
"ecmaVersion": 2022, // Top-level await, etc.
"sourceType": "module",
"ecmaFeatures": {
}
},
"env": {
"node": true
"node": true,
"es2022": true // Defines `Promise`, etc.
},
"extends": "standard",
"extends": [
"eslint:recommended",
"plugin:prettier/recommended"
],
"plugins": [
"license-header"
"import",
"license-header",
"prettier",
"promise",
"n"
],
"rules": {
"license-header/header": ["error", "./dev-utils/license-header.js"],
// Regarding "no-var": The opinion of this repository's maintainers is that
// while const/let are useful, the use of `var` is not bad and therefore
// does not need to be ruled out. Eliminating the use of `var` would be a
// large diff that (a) could theoretically cause bugs due to lexical scoping
// changes and (b) could theoretically impact perf (e.g. see
// https://github.com/microsoft/TypeScript/issues/52924). New code MAY
// prefer const/let over `var`. Code in "examples/" MUST use const/let --
// this is enforced by "examples/.eslintrc.json".
"no-var": "off"

// Retoring some config from standardjs that we want to maintain at least
// for now -- to assist with transition to prettier.
"no-unused-vars": [ // See taav for possible better 'no-unused-vars' rule.
"error",
{
"args": "none",
"caughtErrors": "none",
"ignoreRestSiblings": true,
"vars": "all"
}
],
"no-empty": [
"error",
{
"allowEmptyCatch": true
}
],
"no-constant-condition": [
"error",
{
"checkLoops": false
}
],
"n/handle-callback-err": [
"error",
"^(err|error)$"
],
"n/no-callback-literal": [
"error"
],
"n/no-deprecated-api": [
"error"
],
"n/no-exports-assign": [
"error"
],
"n/no-new-require": [
"error"
],
"n/no-path-concat": [
"error"
],
"n/process-exit-as-throw": [
"error"
],
"promise/param-names": [
"error"
],

// Undo this config from eslint:recommended for now (standardjs didn't have it.)
"require-yield": [ "off" ],

"import/export": "error",
"import/first": "error",
"import/no-absolute-path": ["error", { "esmodule": true, "commonjs": true, "amd": false }],
"import/no-duplicates": "error",
"import/no-named-default": "error",
"import/no-webpack-loader-syntax": "error"
},
"ignorePatterns": [
"/*.example.js", // a pattern for uncommited local dev files to avoid linting
Expand Down
3 changes: 3 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"singleQuote": true
}
Loading

0 comments on commit 701f820

Please sign in to comment.