From 64ca06b7631406a529a7d9f068076cfeb24ee7bc Mon Sep 17 00:00:00 2001 From: samreid Date: Thu, 5 Aug 2021 10:49:13 -0600 Subject: [PATCH] Revert "Revert "Create annual as a versioned clone of perennial, see https://github.com/phetsims/chipper/issues/1018"" This reverts commit 25cacee241319daae825fa2b863797bb4b7db43b. --- eslint/chipper_eslintrc.js | 19 ++++++++++++++++ eslint/rules/bad-chipper-text.js | 30 ++++++++++++++++++++++++++ eslint/rules/todo-should-have-issue.js | 3 ++- 3 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 eslint/chipper_eslintrc.js create mode 100644 eslint/rules/bad-chipper-text.js diff --git a/eslint/chipper_eslintrc.js b/eslint/chipper_eslintrc.js new file mode 100644 index 00000000..ddde4c1c --- /dev/null +++ b/eslint/chipper_eslintrc.js @@ -0,0 +1,19 @@ +// Copyright 2018, University of Colorado Boulder +// @author Michael Kauzmann + + +/** + * The node-specific eslint config applied only to "server-side" files that aren't run in sims. + */ +module.exports = { + extends: './node_eslintrc.js', + env: { + + // specify appropriate environment vars for node code + browser: false, + node: true + }, + rules: { + 'bad-chipper-text': 'error' + } +}; \ No newline at end of file diff --git a/eslint/rules/bad-chipper-text.js b/eslint/rules/bad-chipper-text.js new file mode 100644 index 00000000..ff8d3af4 --- /dev/null +++ b/eslint/rules/bad-chipper-text.js @@ -0,0 +1,30 @@ +// Copyright 2019, University of Colorado Boulder +/* eslint-disable bad-sim-text */ + +/** + * Lint detector for invalid text in chipper + * Lint is disabled for this file so the bad texts aren't themselves flagged. + * + * @author Sam Reid (PhET Interactive Simulations) + * @author Michael Kauzmann (PhET Interactive Simulations) + */ + +module.exports = function( context ) { + + const getBadTextTester = require( './getBadTextTester' ); + + // see getBadTextTester for schema. + const forbiddenTextObjects = [ + + // chipper should use annual instead of perennial, so that it can check out specific versions + '../perennial/js/' + ]; + + return { + Program: getBadTextTester( forbiddenTextObjects, context ) + }; +}; + +module.exports.schema = [ + // JSON Schema for rule options goes here +]; \ No newline at end of file diff --git a/eslint/rules/todo-should-have-issue.js b/eslint/rules/todo-should-have-issue.js index 2e76f06c..4a1042e3 100644 --- a/eslint/rules/todo-should-have-issue.js +++ b/eslint/rules/todo-should-have-issue.js @@ -21,7 +21,8 @@ catch( e ) { let directoriesToRequireIssues = []; if ( buildJSON && buildJSON.common && buildJSON.common.phetLibs ) { - directoriesToRequireIssues = buildJSON.common.phetLibs.filter( x => x !== 'scenery' && x !== 'dot' && x !== 'kite' ); + // Don't require issues in these repos: + directoriesToRequireIssues = buildJSON.common.phetLibs.filter( x => x !== 'scenery' && x !== 'dot' && x !== 'kite' && x !== 'annual' ); if ( buildJSON && buildJSON[ 'phet-io' ] && buildJSON[ 'phet-io' ].phetLibs ) { directoriesToRequireIssues = directoriesToRequireIssues.concat( buildJSON[ 'phet-io' ].phetLibs );