Repository: avajs/eslint-plugin-ava
Pull request #239 (2019-04-30 15:02:13)

Add explanation in docs for fixable rules
> https://github.com/avajs/eslint-plugin-ava/pull/229#issuecomment-487898298

Yes I would.
Is that clear enough ? I'm not sure what more could be said.

sindresorhus: Can you fix the merge conflict?

Patch:
diff --git a/docs/new-rule.md b/docs/new-rule.md
index c4d4b0b..4fafe87 100644
--- a/docs/new-rule.md
+++ b/docs/new-rule.md
@@ -1,5 +1,7 @@
 # Creating a new rule
 
+Translations: [Français](https://github.com/avajs/ava-docs/blob/master/fr_FR/related/eslint-plugin-ava/docs/new-rule.md)
+
 ## Prerequisite
 
 - [Read the ESLint docs on creating a new rule.](https://eslint.org/docs/developer-guide/working-with-rules)
diff --git a/docs/rules/no-invalid-end.md b/docs/rules/no-invalid-end.md
index 25cef9e..5fbebd6 100644
--- a/docs/rules/no-invalid-end.md
+++ b/docs/rules/no-invalid-end.md
@@ -2,7 +2,7 @@
 
 Translations: [Français](https://github.com/avajs/ava-docs/blob/master/fr_FR/related/eslint-plugin-ava/docs/rules/no-invalid-end.md)
 
-AVA will fail if `t.end()` is called in a non-`cb` test function.
+AVA will fail if `t.end()` is called in a non-`.cb` test function.
 
 
 ## Fail
diff --git a/docs/rules/no-todo-implementation.md b/docs/rules/no-todo-implementation.md
index 57db4db..a96701c 100644
--- a/docs/rules/no-todo-implementation.md
+++ b/docs/rules/no-todo-implementation.md
@@ -2,7 +2,7 @@
 
 Translations: [Français](https://github.com/avajs/ava-docs/blob/master/fr_FR/related/eslint-plugin-ava/docs/rules/no-todo-implementation.md)
 
-[`test.todo()`](https://github.com/avajs/ava/blob/master/docs/01-writing-tests.md#test-placeholders-todo) is intended for planning tests. It's not meant to be passed a function to implement the test, and if given one, AVA will throw an error. If you added an implementation, you probably meant to remove the `todo` modifier.
+[`test.todo()`](https://github.com/avajs/ava/blob/master/docs/01-writing-tests.md#test-placeholders-todo) is intended for planning tests. It's not meant to be passed a function to implement the test, and if given one, AVA will throw an error. If you added an implementation, you probably meant to remove the `.todo` modifier.
 
 
 ## Fail
diff --git a/docs/rules/use-t-well.md b/docs/rules/use-t-well.md
index fc76871..a61e57a 100644
--- a/docs/rules/use-t-well.md
+++ b/docs/rules/use-t-well.md
@@ -2,9 +2,9 @@
 
 Translations: [Français](https://github.com/avajs/ava-docs/blob/master/fr_FR/related/eslint-plugin-ava/docs/rules/use-t-well.md)
 
-Prevent the use of unknown assertion methods and the access to members other than the assertion methods and `context`, as well as some known misuses of `t`.
+Prevent the use of unknown assertion methods and the access to members other than the assertion methods and `.context`, as well as some known misuses of `t`.
 
-This rule is partly fixable. It will replace misspelled `falsey` with `falsy`.
+This rule is partly fixable. It will replace misspelled `.falsey` with `.falsy`.
 
 
 ## Fail
@@ -14,12 +14,12 @@ import test from 'ava';
 
 test('main', t => {
 	t(value); // `t` is not a function
-	t.depEqual(value, [2]); // Unknown assertion method `depEqual`
-	t.contxt.foo = 100; // Unknown member `contxt`. Use `context.contxt` instead
-	t.foo = 1000; // Unknown member `foo`. Use `context.foo` instead
+	t.depEqual(value, [2]); // Unknown assertion method `.depEqual`
+	t.contxt.foo = 100; // Unknown member `.contxt`. Use `.context.contxt` instead
+	t.foo = 1000; // Unknown member `.foo`. Use `.context.foo` instead
 	t.deepEqual.is(value, value); // Can't chain assertion methods
 	t.skip(); // Missing assertion method
-	t.deepEqual.skip.skip(); // Too many chained uses of `skip`
+	t.deepEqual.skip.skip(); // Too many chained uses of `.skip`
 });
 ```
 
diff --git a/rules/no-duplicate-modifiers.js b/rules/no-duplicate-modifiers.js
index cffaa60..fdc391f 100644
--- a/rules/no-duplicate-modifiers.js
+++ b/rules/no-duplicate-modifiers.js
@@ -33,7 +33,7 @@ const create = context => {
 				if (prev.name === current.name) {
 					context.report({
 						node: current,
-						message: `Duplicate test modifier \`${current.name}\`.`
+						message: `Duplicate test modifier \`.${current.name}\`.`
 					});
 				}
 
diff --git a/rules/no-unknown-modifiers.js b/rules/no-unknown-modifiers.js
index 27138ef..5113e19 100644
--- a/rules/no-unknown-modifiers.js
+++ b/rules/no-unknown-modifiers.js
@@ -33,7 +33,7 @@ const create = context => {
 			if (unknown.length !== 0) {
 				context.report({
 					node: unknown[0],
-					message: `Unknown test modifier \`${unknown[0].name}\`.`
+					message: `Unknown test modifier \`.${unknown[0].name}\`.`
 				});
 			}
 		})
diff --git a/rules/use-t-well.js b/rules/use-t-well.js
index c4533ef..8606d44 100644
--- a/rules/use-t-well.js
+++ b/rules/use-t-well.js
@@ -66,7 +66,7 @@ const create = context => {
 					// Except `t.context()`
 					context.report({
 						node,
-						message: 'Unknown assertion method `context`.'
+						message: 'Unknown assertion method `.context`.'
 					});
 				}
 
@@ -79,7 +79,7 @@ const create = context => {
 					// Except `t.title()`
 					context.report({
 						node,
-						message: 'Unknown assertion method `title`.'
+						message: 'Unknown assertion method `.title`.'
 					});
 				}
 
@@ -90,17 +90,17 @@ const create = context => {
 				if (stats.other.length > 0) {
 					context.report({
 						node,
-						message: `Unknown assertion method \`${stats.other[0]}\`.`
+						message: `Unknown assertion method \`.${stats.other[0]}\`.`
 					});
 				} else if (stats.skip.length > 1) {
 					context.report({
 						node,
-						message: 'Too many chained uses of `skip`.'
+						message: 'Too many chained uses of `.skip`.'
 					});
 				} else if (stats.falsey.length > 0) {
 					context.report({
 						node,
-						message: 'Misspelled `falsy` as `falsey`.',
+						message: 'Misspelled `.falsy` as `.falsey`.',
 						fix: fixer => fixer.replaceText(node.property, 'falsy')
 					});
 				} else if (stats.method.length > 1) {
@@ -117,7 +117,7 @@ const create = context => {
 			} else if (stats.other.length > 0) {
 				context.report({
 					node,
-					message: `Unknown member \`${stats.other[0]}\`. Use \`context.${stats.other[0]}\` instead.`
+					message: `Unknown member \`.${stats.other[0]}\`. Use \`.context.${stats.other[0]}\` instead.`
 				});
 			}
 		})


Test patch:
diff --git a/docs/rules/no-only-test.md b/docs/rules/no-only-test.md
index 80574bd..af2d6fe 100644
--- a/docs/rules/no-only-test.md
+++ b/docs/rules/no-only-test.md
@@ -4,7 +4,7 @@ Translations: [Français](https://github.com/avajs/ava-docs/blob/master/fr_FR/re
 
 It's easy to run only one test with `test.only()` and then forget about it. It's visible in the results, but still easily missed. Forgetting to remove `.only`, means only this one test in the whole file will run, and if not caught, can let serious bugs slip into your codebase.
 
-This rule is fixable.
+This rule is fixable. It will remove the `.only` test modifier. 
 
 
 ## Fail
diff --git a/docs/rules/no-skip-test.md b/docs/rules/no-skip-test.md
index 28172dc..ecec5d7 100644
--- a/docs/rules/no-skip-test.md
+++ b/docs/rules/no-skip-test.md
@@ -2,9 +2,9 @@
 
 Translations: [Français](https://github.com/avajs/ava-docs/blob/master/fr_FR/related/eslint-plugin-ava/docs/rules/no-skip-test.md)
 
-It's easy to make a test skipped with test.skip() and then forget about it. It's visible in the results, but still easily missed.
+It's easy to make a test skipped with `test.skip()` and then forget about it. It's visible in the results, but still easily missed.
 
-This rule is fixable.
+This rule is fixable. It will remove the `.skip` test modifier.
 
 
 ## Fail
diff --git a/test/no-duplicate-modifiers.js b/test/no-duplicate-modifiers.js
index 4b95ca1..aba4c32 100644
--- a/test/no-duplicate-modifiers.js
+++ b/test/no-duplicate-modifiers.js
@@ -31,7 +31,7 @@ const invalid = modifiers.map(modifier => ({
 	errors: [
 		{
 			ruleId,
-			message: `Duplicate test modifier \`${modifier}\`.`,
+			message: `Duplicate test modifier \`.${modifier}\`.`,
 			type: 'Identifier',
 			line: 2,
 			column: 7 + modifier.length
@@ -55,7 +55,7 @@ ruleTester.run('no-duplicate-modifiers', rule, {
 			errors: [
 				{
 					ruleId,
-					message: 'Duplicate test modifier `serial`.',
+					message: 'Duplicate test modifier `.serial`.',
 					type: 'Identifier',
 					line: 2,
 					column: 21
diff --git a/test/no-unknown-modifiers.js b/test/no-unknown-modifiers.js
index db5c641..098d201 100644
--- a/test/no-unknown-modifiers.js
+++ b/test/no-unknown-modifiers.js
@@ -35,7 +35,7 @@ ruleTester.run('no-unknown-modifiers', rule, {
 			code: `${header}test.foo(t => {});`,
 			errors: [{
 				ruleId,
-				message: 'Unknown test modifier `foo`.',
+				message: 'Unknown test modifier `.foo`.',
 				type: 'Identifier',
 				line: 2,
 				column: 6
@@ -45,7 +45,7 @@ ruleTester.run('no-unknown-modifiers', rule, {
 			code: `${header}test.onlu(t => {});`,
 			errors: [{
 				ruleId,
-				message: 'Unknown test modifier `onlu`.',
+				message: 'Unknown test modifier `.onlu`.',
 				type: 'Identifier',
 				line: 2,
 				column: 6
@@ -55,7 +55,7 @@ ruleTester.run('no-unknown-modifiers', rule, {
 			code: `${header}test.beforeeach(t => {});`,
 			errors: [{
 				ruleId,
-				message: 'Unknown test modifier `beforeeach`.',
+				message: 'Unknown test modifier `.beforeeach`.',
 				type: 'Identifier',
 				line: 2,
 				column: 6
@@ -65,7 +65,7 @@ ruleTester.run('no-unknown-modifiers', rule, {
 			code: `${header}test.c.only(t => {});`,
 			errors: [{
 				ruleId,
-				message: 'Unknown test modifier `c`.',
+				message: 'Unknown test modifier `.c`.',
 				type: 'Identifier',
 				line: 2,
 				column: 6
@@ -75,7 +75,7 @@ ruleTester.run('no-unknown-modifiers', rule, {
 			code: `${header}test.cb.onlu(t => {});`,
 			errors: [{
 				ruleId,
-				message: 'Unknown test modifier `onlu`.',
+				message: 'Unknown test modifier `.onlu`.',
 				type: 'Identifier',
 				line: 2,
 				column: 9
@@ -85,7 +85,7 @@ ruleTester.run('no-unknown-modifiers', rule, {
 			code: `${header}test.foo.bar.baz(t => {});`,
 			errors: [{
 				ruleId,
-				message: 'Unknown test modifier `foo`.',
+				message: 'Unknown test modifier `.foo`.',
 				type: 'Identifier',
 				line: 2,
 				column: 6
@@ -95,7 +95,7 @@ ruleTester.run('no-unknown-modifiers', rule, {
 			code: `${header}test.default(t => {});`,
 			errors: [{
 				ruleId,
-				message: 'Unknown test modifier `default`.',
+				message: 'Unknown test modifier `.default`.',
 				type: 'Identifier',
 				line: 2,
 				column: 6
@@ -105,7 +105,7 @@ ruleTester.run('no-unknown-modifiers', rule, {
 			code: `${header}test.test(t => {});`,
 			errors: [{
 				ruleId,
-				message: 'Unknown test modifier `test`.',
+				message: 'Unknown test modifier `.test`.',
 				type: 'Identifier',
 				line: 2,
 				column: 6
diff --git a/test/use-t-well.js b/test/use-t-well.js
index 1667f16..a79ad61 100644
--- a/test/use-t-well.js
+++ b/test/use-t-well.js
@@ -75,39 +75,39 @@ ruleTester.run('use-t-well', rule, {
 		},
 		{
 			code: testCase('t.foo(a, a);'),
-			errors: [error('Unknown assertion method `foo`.')]
+			errors: [error('Unknown assertion method `.foo`.')]
 		},
 		{
 			code: testCase('t.depEqual(a, a);'),
-			errors: [error('Unknown assertion method `depEqual`.')]
+			errors: [error('Unknown assertion method `.depEqual`.')]
 		},
 		{
 			code: testCase('t.deepEqual.skp(a, a);'),
-			errors: [error('Unknown assertion method `skp`.')]
+			errors: [error('Unknown assertion method `.skp`.')]
 		},
 		{
 			code: testCase('t.skp.deepEqual(a, a);'),
-			errors: [error('Unknown assertion method `skp`.')]
+			errors: [error('Unknown assertion method `.skp`.')]
 		},
 		{
 			code: testCase('t.context();'),
-			errors: [error('Unknown assertion method `context`.')]
+			errors: [error('Unknown assertion method `.context`.')]
 		},
 		{
 			code: testCase('t.title();'),
-			errors: [error('Unknown assertion method `title`.')]
+			errors: [error('Unknown assertion method `.title`.')]
 		},
 		{
 			code: testCase('t.a = 1;'),
-			errors: [error('Unknown member `a`. Use `context.a` instead.')]
+			errors: [error('Unknown member `.a`. Use `.context.a` instead.')]
 		},
 		{
 			code: testCase('t.ctx.a = 1;'),
-			errors: [error('Unknown member `ctx`. Use `context.ctx` instead.')]
+			errors: [error('Unknown member `.ctx`. Use `.context.ctx` instead.')]
 		},
 		{
 			code: testCase('t.deepEqu;'),
-			errors: [error('Unknown member `deepEqu`. Use `context.deepEqu` instead.')]
+			errors: [error('Unknown member `.deepEqu`. Use `.context.deepEqu` instead.')]
 		},
 		{
 			code: testCase('t.deepEqual.is(a, a);'),
@@ -115,7 +115,7 @@ ruleTester.run('use-t-well', rule, {
 		},
 		{
 			code: testCase('t.paln(1);'),
-			errors: [error('Unknown assertion method `paln`.')]
+			errors: [error('Unknown assertion method `.paln`.')]
 		},
 		{
 			code: testCase('t.skip();'),
@@ -123,12 +123,12 @@ ruleTester.run('use-t-well', rule, {
 		},
 		{
 			code: testCase('t.deepEqual.skip.skip(a, a);'),
-			errors: [error('Too many chained uses of `skip`.')]
+			errors: [error('Too many chained uses of `.skip`.')]
 		},
 		{
 			code: testCase('t.falsey(a);'),
 			output: testCase('t.falsy(a);'),
-			errors: [error('Misspelled `falsy` as `falsey`.')]
+			errors: [error('Misspelled `.falsy` as `.falsey`.')]
 		}
 	]
 });