Skip to content

Commit

Permalink
Create lint rule to enforce strings in Record<string, ...> types (#…
Browse files Browse the repository at this point in the history
…1120)

Google Closure Compiler likes to mangle keys in Record<string, ...> declarations unless they are string literals. This enforces string literals in such declarations.
  • Loading branch information
Will Scullin authored May 25, 2023
1 parent 58e501e commit 79aef14
Show file tree
Hide file tree
Showing 17 changed files with 803 additions and 330 deletions.
10 changes: 5 additions & 5 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
{
"extends": "./node_modules/gts/",
"parserOptions": {
"warnOnUnsupportedTypeScriptVersion": false
"warnOnUnsupportedTypeScriptVersion": false,
"project": "./tsconfig.packages.json"
},
"ignorePatterns": [
"*.d.ts",
"node_modules/",
"packages/malloy/src/lang/lib/Malloy",
"dist/"
],
"plugins": ["@malloydata/lint"],
"rules": {
"no-console": "warn",
"prettier/prettier": ["error", {"quoteProps": "preserve"}],
Expand Down Expand Up @@ -39,9 +41,7 @@
"warn",
{"prefer": "parameter-property"}
],
"quote-props": [
"error",
"consistent"
]
"quote-props": ["error", "consistent"],
"@malloydata/lint/quote-string-properties": "error"
}
}
5 changes: 3 additions & 2 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
module.exports = {
...require('gts/.prettierrc.json')
}
...require('gts/.prettierrc.json'),
quoteProps: 'preserve',
};
Loading

0 comments on commit 79aef14

Please sign in to comment.