Skip to content

Commit

Permalink
fix(no-this-expression): no-this -> no-this-expression
Browse files Browse the repository at this point in the history
  • Loading branch information
Rebecca Stevens committed Jul 30, 2019
1 parent a4d2314 commit 24cde61
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ See [@typescript-eslint/parser's README.md](https://github.com/typescript-eslint

| Name | Description | <span title="No Object-Orientation">:see_no_evil:</span> | <span title="Lite">:hear_no_evil:</span> | <span title="Recommended">:speak_no_evil:</span> | :wrench: | :blue_heart: |
| ------------------------------------------------------------ | ------------------------------------------------------------------------ | :------------------------------------------------------: | :--------------------------------------: | :----------------------------------------------: | :------: | :---------------: |
| [`no-this`](./docs/rules/no-this.md) | Disallow `this` access | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | |
| [`no-this-expression`](./docs/rules/no-this-expression.md) | Disallow `this` access | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | |
| [`no-class`](./docs/rules/no-class.md) | Disallow classes | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | |
| [`no-mixed-type`](./docs/rules/no-mixed-type.md) | Restrict types so that only members of the same kind are allowed in them | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | :thought_balloon: |
| [`prefer-type-literal`](./docs/rules/prefer-type-literal.md) | Use type literals over interfaces | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | :thought_balloon: |
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-class.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Disallow use of the `class` keyword.

## Rule Details

Thanks to libraries like [recompose](https://github.com/acdlite/recompose) and Redux's [React Container components](http://redux.js.org/docs/basics/UsageWithReact.html), there's not much reason to build Components using `React.createClass` or ES6 classes anymore. The `no-this` rule makes this explicit.
Thanks to libraries like [recompose](https://github.com/acdlite/recompose) and Redux's [React Container components](http://redux.js.org/docs/basics/UsageWithReact.html), there's not much reason to build Components using `React.createClass` or ES6 classes anymore. The `no-this-expression` rule makes this explicit.

```typescript
const Message = React.createClass({
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-this.md → docs/rules/no-this-expression.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Disallow this access (no-this)
# Disallow this access (no-this-expression)

See the [no-class](./no-class.md) rule for more info.
2 changes: 1 addition & 1 deletion src/configs/all.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const config = {
"functional/no-let": "error",
"functional/no-loop-statement": "error",
"functional/no-promise-reject": "error",
"functional/no-this": "error",
"functional/no-this-expression": "error",
"functional/no-throw-statement": "error",
"functional/no-try-statement": "error"
},
Expand Down
2 changes: 1 addition & 1 deletion src/configs/no-object-orientation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import recommended from "./external-recommended";

const config = deepMerge(recommended, {
rules: {
"functional/no-this": "error",
"functional/no-this-expression": "error",
"functional/no-class": "error"
},
overrides: [
Expand Down
7 changes: 5 additions & 2 deletions src/rules/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ import {
name as noReturnVoidName,
rule as noReturnVoid
} from "./no-return-void";
import { name as noThisRuleName, rule as noThisRule } from "./no-this";
import {
name as noThisExpressionRuleName,
rule as noThisExpressionRule
} from "./no-this-expression";
import {
name as noThrowStatementRuleName,
rule as noThrowStatementRule
Expand Down Expand Up @@ -69,7 +72,7 @@ export const rules = {
[noMixedInterfaceRuleName]: noMixedInterfaceRule,
[noPromiseRejectRuleName]: noPromiseRejectRule,
[noReturnVoidName]: noReturnVoid,
[noThisRuleName]: noThisRule,
[noThisExpressionRuleName]: noThisExpressionRule,
[noThrowStatementRuleName]: noThrowStatementRule,
[noTryStatementRuleName]: noTryStatementRule,
[preferReadonlyTypesRuleName]: preferReadonlyTypesRule,
Expand Down
2 changes: 1 addition & 1 deletion src/rules/no-this.ts → src/rules/no-this-expression.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from "../util/rule";

// The name of this rule.
export const name = "no-this" as const;
export const name = "no-this-expression" as const;

// The options this rule can take.
type Options = {};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/**
* @file Tests for no-this.
* @file Tests for no-this-expression.
*/

import { RuleTester } from "eslint";

import { name, rule } from "../../src/rules/no-this";
import { name, rule } from "../../src/rules/no-this-expression";

import { es3, typescript } from "../helpers/configs";
import {
Expand Down

0 comments on commit 24cde61

Please sign in to comment.