@@ -218,6 +218,29 @@ rules[ 'curly' ] = 'error';
218218*/
219219rules [ 'default-case' ] = 'error' ;
220220
221+ /**
222+ * Always require default parameters to be last.
223+ *
224+ * @name default-param-last
225+ * @memberof rules
226+ * @type {string }
227+ * @default 'error'
228+ * @see [default-param-last]{@link http://eslint.org/docs/rules/default-param-last}
229+ *
230+ * @example
231+ * // Bad...
232+ * function foo( a = 1, b ) {
233+ * // No-op...
234+ * }
235+ *
236+ * @example
237+ * // Good...
238+ * function foo( b, a = 1 ) {
239+ * // No-op...
240+ * }
241+ */
242+ rules [ 'default-param-last' ] = 'error' ;
243+
221244/**
222245* Require that a dot be on the same line as a property.
223246*
@@ -856,6 +879,25 @@ rules[ 'no-multi-spaces' ] = [ 'error', {
856879*/
857880rules [ 'no-multi-str' ] = 'error' ;
858881
882+ /**
883+ * Never allow use the `new` operator without assignment.
884+ *
885+ * @name no-new
886+ * @memberof rules
887+ * @type {string }
888+ * @default 'error'
889+ * @see [no-new]{@link http://eslint.org/docs/rules/no-new}
890+ *
891+ * @example
892+ * // Bad...
893+ * new Foo();
894+ *
895+ * @example
896+ * // Good...
897+ * var f = new Foo();
898+ */
899+ rules [ 'no-new' ] = 'error' ;
900+
859901/**
860902* Never allow using the `Function` constructor to create functions.
861903*
@@ -897,23 +939,23 @@ rules[ 'no-new-func' ] = 'error';
897939rules [ 'no-new-wrappers' ] = 'error' ;
898940
899941/**
900- * Never allow use the `new` operator without assignment .
942+ * Never allow octal literals that begin with a leading zero; e.g., 071 (=> 57) .
901943*
902- * @name no-new
944+ * @name no-octal
903945* @memberof rules
904946* @type {string }
905947* @default 'error'
906- * @see [no-new ]{@link http://eslint.org/docs/rules/no-new }
948+ * @see [no-octal ]{@link http://eslint.org/docs/rules/no-octal }
907949*
908950* @example
909951* // Bad...
910- * new Foo() ;
952+ * var num = 071 ;
911953*
912954* @example
913955* // Good...
914- * var f = new Foo() ;
956+ * var num = '071' ;
915957*/
916- rules [ 'no-new ' ] = 'error' ;
958+ rules [ 'no-octal ' ] = 'error' ;
917959
918960/**
919961* Never allow octal escape sequences, which are deprecated.
@@ -934,25 +976,6 @@ rules[ 'no-new' ] = 'error';
934976*/
935977rules [ 'no-octal-escape' ] = 'error' ;
936978
937- /**
938- * Never allow octal literals that begin with a leading zero; e.g., 071 (=> 57).
939- *
940- * @name no-octal
941- * @memberof rules
942- * @type {string }
943- * @default 'error'
944- * @see [no-octal]{@link http://eslint.org/docs/rules/no-octal}
945- *
946- * @example
947- * // Bad...
948- * var num = 071;
949- *
950- * @example
951- * // Good...
952- * var num = '071';
953- */
954- rules [ 'no-octal' ] = 'error' ;
955-
956979/**
957980* Allow parameter reassignment (although bugs can arise when doing so).
958981*
@@ -1233,6 +1256,36 @@ rules[ 'no-unused-labels' ] = 'error';
12331256*/
12341257rules [ 'no-useless-call' ] = 'error' ;
12351258
1259+ /**
1260+ * Never allow unnecessary catch clauses.
1261+ *
1262+ * @name no-useless-catch
1263+ * @memberof rules
1264+ * @type {string }
1265+ * @default 'error'
1266+ * @see [no-useless-catch]{@link http://eslint.org/docs/rules/no-useless-catch}
1267+ *
1268+ * @example
1269+ * // Bad...
1270+ * try {
1271+ * throw new Error( 'beep' );
1272+ * } catch ( err ) {
1273+ * // Catch is unnecessary if we are just rethrowing...
1274+ * throw err;
1275+ * }
1276+ *
1277+ * @example
1278+ * // Good...
1279+ * try {
1280+ * throw new Error( 'beep' );
1281+ * } catch ( err ) {
1282+ * if ( err instanceof TypeError) {
1283+ * throw err;
1284+ * }
1285+ * }
1286+ */
1287+ rules [ 'no-useless-catch' ] = 'error' ;
1288+
12361289/**
12371290* Never allow concatenation of two string literals which can be combined as a single literal.
12381291*
@@ -1347,6 +1400,17 @@ rules[ 'no-warning-comments' ] = [ 'warn', {
13471400*/
13481401rules [ 'no-with' ] = 'error' ;
13491402
1403+ /**
1404+ * Do not require the use of ES2018 named capture groups.
1405+ *
1406+ * @name prefer-named-capture-group
1407+ * @memberof rules
1408+ * @type {string }
1409+ * @default 'off'
1410+ * @see [prefer-named-capture-group]{@link http://eslint.org/docs/rules/prefer-named-capture-group}
1411+ */
1412+ rules [ 'prefer-named-capture-group' ] = 'off' ;
1413+
13501414/**
13511415* Always require that promises are rejected with `Error` objects.
13521416*
@@ -1359,6 +1423,25 @@ rules[ 'prefer-promise-reject-errors' ] = [ 'error', {
13591423 'allowEmptyReject' : false
13601424} ] ;
13611425
1426+ /**
1427+ * Always require regular expression literals when not dynamically generating a regular expression.
1428+ *
1429+ * @name prefer-regex-literals
1430+ * @memberof rules
1431+ * @type {string }
1432+ * @default 'error'
1433+ * @see [prefer-regex-literals]{@link https://eslint.org/docs/rules/prefer-regex-literals}
1434+ *
1435+ * @example
1436+ * // Bad...
1437+ * var re = new RegExp( 'foo' );
1438+ *
1439+ * @example
1440+ * // Good...
1441+ * var re = /foo/;
1442+ */
1443+ rules [ 'prefer-regex-literals' ] = 'error' ;
1444+
13621445/**
13631446* Always require a `radix` parameter to `parseInt()`.
13641447*
@@ -1405,6 +1488,25 @@ rules[ 'require-await' ] = 'error';
14051488
14061489/* eslint-enable stdlib/jsdoc-doctest-marker, stdlib/jsdoc-doctest-quote-props */
14071490
1491+ /**
1492+ * Always require the `u` flag when a regular expression involves UTF-16 surrogate pairs.
1493+ *
1494+ * @name require-unicode-regexp
1495+ * @memberof rules
1496+ * @type {string }
1497+ * @default 'error'
1498+ * @see [require-unicode-regexp]{@link http://eslint.org/docs/rules/require-unicode-regexp}
1499+ *
1500+ * @example
1501+ * // Bad...
1502+ * var re = /^[👍]$/;
1503+ *
1504+ * @example
1505+ * // Good...
1506+ * var re = /^[👍]$/u;
1507+ */
1508+ rules [ 'require-unicode-regexp' ] = 'error' ;
1509+
14081510/**
14091511* Always declare variables at the top of their scope to represent hoisting.
14101512*
0 commit comments