Skip to content

Commit

Permalink
Merge pull request Agoric#7285 from Agoric/ari/7283
Browse files Browse the repository at this point in the history
lint: adds a warn lint for incorrect terminology
  • Loading branch information
mergify[bot] authored Mar 31, 2023
2 parents 5402e18 + e3da429 commit 501fa39
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
/* eslint-disable no-restricted-syntax */
/* eslint-env node */
const process = require('process');

const lintTypes = !!process.env.AGORIC_ESLINT_TYPES;

const deprecatedTerminology = [
['currency', 'brand, asset or another descriptor'],
['loan', 'debt'],
['blacklist', 'denylist'],
['whitelist', 'allowlist'],
['RUN', 'IST', '/RUN/'],
].flatMap(([bad, good, badRgx = `/${bad}/i`]) =>
['Literal', 'TemplateLiteral', 'Identifier'].map(selectorType => ({
selector: `${selectorType}[value=${badRgx}]`,
message: `Use '${good}' instead of deprecated '${bad}'`,
})),
);

module.exports = {
root: true,
parser: '@typescript-eslint/parser',
Expand Down Expand Up @@ -30,6 +44,7 @@ module.exports = {
// CI has a separate format check but keep this warn to maintain that "eslint --fix" prettifies
// UNTIL https://github.com/Agoric/agoric-sdk/issues/4339
'prettier/prettier': 'warn',
'no-restricted-syntax': ['warn', ...deprecatedTerminology],
},
settings: {
jsdoc: {
Expand Down

0 comments on commit 501fa39

Please sign in to comment.