mirror of
https://github.com/hanzoai/babel.git
synced 2026-09-24 16:56:45 +00:00
* Flow ParseError version. Reviewed by @tolmasky. * Begin updating everything. Reviewed by @tolmasky. * Convert more. Reviewed by @tolmasky. * Add more. Reviewed by @tolmasky. * Fix. Reviewed by @tolmasky. * Just switch everything to exact types. Reviewed by @tolmasky. * Style fixes. Reviewed by @tolmasky. * Fix remaining style issues and remove unecessary dry-error-messages. Reviewed by @tolmasky. * Don't use enums and address more issues. Reviewed by @tolmasky. * More fixes. Reviewed by @tolmasky. * Workaround for import situation. Reviewed by @tolmasky. * Fix a bunch of errors messages. Reviewed by @tolmasky. * Fix some flow stuff. Reviewed by @tolmasky. * Add a way to specify code. Reviewed by @tolmasky. * Fix lint errors. Reviewed by @tolmasky. * Fix Flow errors. Reviewed by @tolmasky. Another Flow things. Reviewed by @tolmasky. Fix Flow error. Reviewed by @tolmasky. Fix flow errors. Reviewed by @tolmasky. Fix flow error. Reviewed by @tolmasky. * See if this gets the name right. Reviewed by @tolmasky. * Add comments to raise and raiseOverwrite. Reviewed by @tolmasky. * Remove forward declaration. Reviewed by @tolmasky. * Change option to be kind. Reviewed by @tolmasky. * Fix for ambient context not being respected in variable declarations. Reviewed by @tolmasky. * Make IllegalBreakContinue based on type. Reviewed by @tolmasky. * Begin moving checkLVal to type-based system instead of contextDescription-based system, and fix let error in the process as well. Reviewed by @tolmasky. * Switch to isValidLVal. Reviewed by @tolmasky. * Don't use checkLVal for class names. Reviewed by @tolmasky. * Fix some Flow errors. Reviewed by @tolmasky. * Temporary fix for Flow error. Reviewed by @tolmasky. * Remove unused stuff. Reviewed by @tolmasky. * Try this. Reviewed by @tolmasky. * Don't use Object.fromEntries. Reviewed by @tolmasky. * Fix linter error. Reviewed by @tolmasky. * Fix for SyntaxError. Reviewed by @tolmasky. * Add TS1039 Initializers are not allowed in ambient contexts. to error-codes.js. Reviewed by @tolmasky. * Add TS1155 'const' declarations must be initialized. Reviewed by @tolmasky. * Allow consts with literals. Reviewed by @tolmasky. * Add enum support. Reviewed by @tolmasky. * Add filename to test runner to correctly identify .d.ts files. Reviewed by @tolmasky. * Only ignore reserved words in ambient contexts. Parse interface in parseStatementContent. Fix enums. Reviewed by @tolmasky. * Fix simple parameter error. Reviewed by @tolmasky. * Type references should allow reserved words (I believe we were just getting away with the fact that we turned reserved words off before). Reviewed by @tolmasky. * Allow import and export in TypeScript regardless of module or script. Reviewed by @tolmasky. * Fix declare enum and interface and reorganize the code a bit. Reviewed by @tolmasky. * Fix for keywords in export as. Reviewed by @tolmasky. * Fix reserved words in import types. Reviewed by @tolmasky. * Rename files. Reviewed by @tolmasky. * Add 1 * Remove files form allowlist that no longer need to be there. Reviewed by @tolmasky. * Parse as separate files and switch to only using error codes. Reviewed by @tolmasky. * Fix reading files with different encodings. Reviewed by @tolmasky. * Fix outside tests. Reviewed by @tolmasky. * Change test to pass since typescript should allow import. Reviewed by @tolmasky. * Update tests that should fail. Reviewed by @tolmasky. * Add tests for complex let assignments. Reviewed by @tolmasky. * Choose a better name for these. Reviewed by @tolmasky. * Add tests for a number of left-hand side expressions. Reviewed by @tolmasky. * Change name to kind. Reviewed by @tolmasky. * Choose better parameter names for these errors. Reviewed by @tolmasky. * Use error credentials and error details. Reviewed by @tolmasky. * Fix some names and add comments. Reviewed by @tolmasky. * Get rid of unused option. Reviewed by @tolmasky. * Better names. Reviewed by @tolmasky. * Split out pipeline errors and choose better names. Reviewed by @tolmasky. * Clean up LVal stuff. reviewed by @tolmasky. * Use "unambiguous" to determine whether to parse typescript tests as module or script, and stop always allowing imports in Typescript. Reviewed by @tolmasky. * Revert test to previous state. Reviewed by @tolmasky. * Better name for this. Reviewed by @tolmasky. * Add these back in. Reviewed by @tolmasky. * Add these. Reviewed by @tolmasky. * Fix flow errors and use toNodeDescription in more places. Reviewed by @tolmasky. * Rename LHSParent to LValAncestor. Reviewed by @tolmasky. * Add ParseError.clone and change symbol name to DefaultMessage from NoMessage. Reviewed by @tolmasky. * Change name to identifierName in a bunch of places. Reviewed by @tolmasky. * Fix for using type. Reviewed by @tolmasky. * Better names. Reviewed by @tolmasky. * Clean up API and add comments. Reviewed by @tolmasky. * Change name. Reviewed by @tolmasky. * Better names. Reviewed by @tolmasky. * Minor comment fix. Reviewed by @tolmasky. * Remove no longer used method. Reviewed by @tolmasky. * Update packages/babel-parser/src/parser/lval.js Co-authored-by: Nicolò Ribaudo <[email protected]> * Update packages/babel-parser/src/parser/lval.js Co-authored-by: Nicolò Ribaudo <[email protected]> * Minor grammar changes to comments. Reviewed by @tolmasky. * Use trim instead of slice(0, -1). Reviewed by @tolmasky. * Add a comment to explain the tagged template stuff. Reviewed by @tolmasky. * Use maxArgumentCount. Reviewed by @tolmasky. * Don't allow UpdateExpression without prefix. Reviewed by @tolmasky. * Add tds test for no-initializer. Reviewed by @tolmasky. * Make this test test ASI and not const initializers. Reviewed by @tolmasky. * Update packages/babel-parser/src/parser/expression.js Co-authored-by: Nicolò Ribaudo <[email protected]> * Change template string to normal string and remove default. Reviewed by @tolmasky. * Get rid of ParseError class and use SyntaxErrors instead. Reviewed by @tolmasky. * Update packages/babel-parser/src/parse-error.js Co-authored-by: Huáng Jùnliàng <[email protected]> * Remove this comment since we don't need this argument anymore. Reviewed by @tolmasky. * Use this in toMessage and restore clone method. Reviewed by @tolmasky. * Make sure pos and missingPlugin are enumerable. Reviewed by @tolmasky. * Make typescript tests faster by checking the bom manually. Reviewed by @tolmasky. * Update packages/babel-parser/src/parser/lval.js Co-authored-by: Nicolò Ribaudo <[email protected]> * Update packages/babel-parser/src/plugins/estree.js Co-authored-by: Nicolò Ribaudo <[email protected]> * Update packages/babel-parser/src/plugins/typescript/index.js Co-authored-by: Nicolò Ribaudo <[email protected]> * Update packages/babel-parser/src/plugins/typescript/index.js Co-authored-by: Nicolò Ribaudo <[email protected]> * Clarify const enum initialization comment. Reviewed by @tolmasky. * Fix Flow being angry because __proto__: null makes it think that the return type can be null. Reviewed by @tolmasky. * Don't automatically set DTS on the typescript plugin based on filename. Reviewed by @tolmasky. * Fix duplicated export error. Reviewed by @tolmasky. Co-authored-by: Nicolò Ribaudo <[email protected]> Co-authored-by: Huáng Jùnliàng <[email protected]>
1.9 KiB
1.9 KiB
@babel/eslint-plugin-development-internal
The Babel team's custom ESLint rules for the babel/babel monorepo.
Installation
$ npm install --save-dev @babel/eslint-plugin-development-internal
or
$ yarn add --save-dev @babel/eslint-plugin-development-internal
Usage
The plugin can be loaded in your .eslintrc.* configuration file as follows: (note that you can omit the eslint-plugin- prefix):
{
"plugins": ["@babel/development-internal"]
}
Rules
@babel/development-internal/report-error-message-format
This rule is inspired by https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/blob/master/docs/rules/report-message-format.md.
Intended for use in packages/babel-parser/src/**/*. When enabled, this rule warns for inconsistently error messages format in arguments of makeErrorTemplates function calls.
Basically, it starts with an uppercase Latin letter(A~Z) and ends with a period(.) or a question(?). But it can start with 'keyword' or `code` to include JavaScript keywords or code in error messages.
valid:
makeErrorTemplates({ ThisIsAnError: "This is an error." });
makeErrorTemplates({ ThisIsAnError: "'this' is an error." });
makeErrorTemplates({ ThisIsAnError: "`this` is an error." });
makeErrorTemplates({ ThisIsAnError: "This is an error?" });
makeErrorTemplates({ ThisIsAnError: "'this' is an error?" });
makeErrorTemplates({ ThisIsAnError: "`this` is an error?" });
invalid:
makeErrorTemplates({ ThisIsAnError: 'this is an error.' });
makeErrorTemplates({ ThisIsAnError: 'This is an error' });
makeErrorTemplates({ ThisIsAnError: 'this is an error?' });
makeErrorTemplates({ ThisIsAnError: '`this` is an error' });
makeErrorTemplates({ ThisIsAnError: "'this' is an error" });
Example configuration:
{
rules: {
"@babel/development-internal/report-error-message-format": "error"
}
}