Skip to content

Commit

Permalink
Update style re: prefer-at and prefer-negative-index
Browse files Browse the repository at this point in the history
  • Loading branch information
larouxn committed Jun 7, 2023
1 parent 2045266 commit 128c741
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/options-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ test('buildConfig: prettier: true', t => {
trailingComma: 'all',
}]);
// eslint-prettier-config must always be last
t.is(config.baseConfig.extends[config.baseConfig.extends.length - 1], 'plugin:prettier/recommended');
t.is(config.baseConfig.extends.at(-1), 'plugin:prettier/recommended');
// Indent rule is not enabled
t.is(config.baseConfig.rules.indent, undefined);
// Semi rule is not enabled
Expand All @@ -125,8 +125,8 @@ test('buildConfig: prettier: true, typescript file', t => {
}]);

// eslint-prettier-config must always be last
t.is(config.baseConfig.extends[config.baseConfig.extends.length - 1], 'plugin:prettier/recommended');
t.regex(config.baseConfig.extends[config.baseConfig.extends.length - 2], /xo-typescript/);
t.is(config.baseConfig.extends.at(-1), 'plugin:prettier/recommended');
t.regex(config.baseConfig.extends.at(-2), /xo-typescript/);

// Indent rule is not enabled
t.is(config.baseConfig.rules.indent, undefined);
Expand Down Expand Up @@ -430,7 +430,7 @@ test('buildConfig: extends', t => {
test('buildConfig: typescript', t => {
const config = manager.buildConfig({ts: true, tsConfigPath: './tsconfig.json'});

t.regex(config.baseConfig.extends[config.baseConfig.extends.length - 1], /xo-typescript/);
t.regex(config.baseConfig.extends.at(-1), /xo-typescript/);
t.is(config.baseConfig.parser, require.resolve('@typescript-eslint/parser'));
t.deepEqual(config.baseConfig.parserOptions, {
warnOnUnsupportedTypeScriptVersion: false,
Expand Down

0 comments on commit 128c741

Please sign in to comment.