Skip to content

Commit f44794e

Browse files
author
[Interfaced] Кирилл Дронкин
committed
1.6.0
1 parent 82e4a9b commit f44794e

File tree

71 files changed

+1156
-1046
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+1156
-1046
lines changed

CHANGELOG.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,26 @@
11
# Change log
22

3+
## 1.6.0 (release date: 6.12.2018)
4+
5+
* `caps-const`: fixed an exception on enum-variables checking
6+
* `event-const-value`: fixed an exception on constant-variables checking
7+
8+
* New rules:
9+
- `singular-enum`
10+
- `no-jsdoc-type-multi-spaces`
11+
12+
* Renamed rules:
13+
- `no-tabs-in-jsdoc-type` -> `no-jsdoc-type-tabs`
14+
15+
* Removed rules:
16+
- `statics-order`
17+
- `lines-between-static`
18+
- `prevent-unused-typedef-vars`
19+
20+
* Added `type` field to rule metas
21+
* Support for global constants, enums and typedefs
22+
* Support for exported constants, enums and typedefs
23+
324
## 1.5.0 (release date: 19.10.2018)
425

526
* `abstract-class-name-prefix`, `interface-name-prefix`: handle anonymous class declarations
@@ -41,7 +62,7 @@
4162

4263
* `lines-around-class`: use `1` as the default value for `before` and `after`
4364
* `prefer-shorthand-jsdoc-types`: autofixing; removed `consistent` option
44-
* `jsdoc-type-spacing`: autofixing; completely new options (see docs/rules/jsdoc-type-spacing)
65+
* `jsdoc-type-spacing`: autofixing; completely new options (see `docs/rules/jsdoc-type-spacing`)
4566
* `jsdoc-type-application-dot`: autofixing
4667
* `jsdoc-tags-order`: autofixing
4768

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright © 2017 Interfaced
3+
Copyright © 2017-2018 Interfaced
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the “Software”), to deal

README.md

Lines changed: 44 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# eslint-plugin-interfaced
22

3-
[ESLint](https://eslint.org) plugin with rules for the approaches adopted by [Interfaced](http://interfaced.tv) company.
3+
[ESLint](https://eslint.org) plugin with essential rules for [Closure Compiler](https://developers.google.com/closure/compiler/) environment and [JSDoc](http://usejsdoc.org/).
44

55
## Usage
66

@@ -10,7 +10,7 @@
1010
npm i eslint-plugin-interfaced --save-dev
1111
```
1212

13-
2) Specify "interfaced" as a plugin in your .eslintrc:
13+
2) Specify "interfaced" as a plugin in your `.eslintrc`:
1414

1515
```json
1616
{
@@ -20,7 +20,7 @@ npm i eslint-plugin-interfaced --save-dev
2020
}
2121
```
2222

23-
3) Enable all of the rules that you would like to use in your .eslintrc:
23+
3) Enable all of the rules that you would like to use in your `.eslintrc`:
2424

2525
```json
2626
{
@@ -32,38 +32,47 @@ npm i eslint-plugin-interfaced --save-dev
3232

3333
## Rules
3434

35-
* [interfaced/abstract-class-name-prefix](docs/rules/abstract-class-name-prefix.md)
36-
* [interfaced/capitalized-enum](docs/rules/capitalized-enum.md)
37-
* [interfaced/capitalized-typedef](docs/rules/capitalized-typedef.md)
38-
* [interfaced/caps-const](docs/rules/caps-const.md)
39-
* [interfaced/event-const-desc](docs/rules/event-const-desc.md)
40-
* [interfaced/event-const-value](docs/rules/event-const-value.md)
41-
* [interfaced/interface-name-prefix](docs/rules/interface-name-prefix.md)
42-
* [interfaced/jsdoc-tags-order](docs/rules/jsdoc-tags-order.md)
43-
* [interfaced/jsdoc-type-application-dot](docs/rules/jsdoc-type-application-dot.md)
44-
* [interfaced/jsdoc-type-indent](docs/rules/jsdoc-type-indent.md)
45-
* [interfaced/jsdoc-type-spacing](docs/rules/jsdoc-type-spacing.md)
46-
* [interfaced/lines-around-class](docs/rules/lines-around-class.md)
47-
* [interfaced/lines-between-methods](docs/rules/lines-between-methods.md)
48-
* [interfaced/lines-between-props](docs/rules/lines-between-props.md)
49-
* [interfaced/lines-between-statics](docs/rules/lines-between-statics.md)
50-
* [interfaced/methods-order](docs/rules/methods-order.md)
51-
* [interfaced/no-empty-method](docs/rules/no-empty-method.md)
52-
* [interfaced/no-public-underscore](docs/rules/no-public-underscore.md)
53-
* [interfaced/no-restricted-jsdoc-tags](docs/rules/no-restricted-jsdoc-tags.md)
54-
* [interfaced/no-tabs-in-jsdoc-type](docs/rules/no-tabs-in-jsdoc-type.md)
55-
* [interfaced/prefer-shorthand-jsdoc-types](docs/rules/prefer-shorthand-jsdoc-types.md)
56-
* [interfaced/prevent-unused-jsdoc-types](docs/rules/prevent-unused-jsdoc-types.md)
57-
* [interfaced/prevent-unused-meta-params](docs/rules/prevent-unused-meta-params.md)
58-
* [interfaced/prevent-unused-typedef-vars](docs/rules/prevent-unused-typedef-vars.md)
59-
* [interfaced/props-order](docs/rules/props-order.md)
60-
* [interfaced/statics-order](docs/rules/statics-order.md)
61-
* [interfaced/typecast-spacing](docs/rules/typecast-spacing.md)
62-
63-
## Redefined rules
64-
65-
Some useful rules which are provided by ESLint are slightly inappropriate for Closure Compiler environment,
66-
so we redefine them with some adjusting for our requirements.
35+
### JSDoc
36+
37+
* [interfaced/jsdoc-tags-order](docs/rules/jsdoc-tags-order.md) - enforce the specified order for JSDoc tags
38+
* [interfaced/jsdoc-type-application-dot](docs/rules/jsdoc-type-application-dot.md) - enforce dot before "<" symbol in JSDoc type application
39+
* [interfaced/jsdoc-type-indent](docs/rules/jsdoc-type-indent.md) - enforce consistent indentation in JSDoc type
40+
* [interfaced/jsdoc-type-spacing](docs/rules/jsdoc-type-spacing.md) - enforce consistent spacing in JSDoc type
41+
* [interfaced/no-jsdoc-type-multi-spaces](docs/rules/no-jsdoc-type-multi-spaces.md) - disallow multiple spaces in JSDoc type
42+
* [interfaced/no-jsdoc-type-tabs](docs/rules/no-jsdoc-type-tabs.md) - disallow tab characters in JSDoc type
43+
* [interfaced/no-restricted-jsdoc-tags](docs/rules/no-restricted-jsdoc-tags.md) - disallow the specified JSDoc tags
44+
* [interfaced/prefer-shorthand-jsdoc-types](docs/rules/prefer-shorthand-jsdoc-types.md) - enforce usage of a shorthand notation for some JSDoc types
45+
* [interfaced/prevent-unused-jsdoc-types](docs/rules/prevent-unused-jsdoc-types.md) - prevent variables used in JSDoc type to be marked as unused
46+
47+
### Naming convention
48+
49+
* [interfaced/abstract-class-name-prefix](docs/rules/abstract-class-name-prefix.md) - enforce "Abstract" prefix for abstract class name
50+
* [interfaced/capitalized-enum](docs/rules/capitalized-enum.md) - enforce capitalization of the first letter of an enum
51+
* [interfaced/capitalized-typedef](docs/rules/capitalized-typedef.md) - enforce capitalization of the first letter of a typedef
52+
* [interfaced/caps-const](docs/rules/caps-const.md) - enforce caps notation for constant name and enum properties
53+
* [interfaced/event-const-desc](docs/rules/event-const-desc.md) - enforce event description ("Fired with: ...") for event constant
54+
* [interfaced/event-const-value](docs/rules/event-const-value.md) - enforce event constant value to be a lowercase latin string with dash sign delimiter
55+
* [interfaced/interface-name-prefix](docs/rules/interface-name-prefix.md) - enforce "I" prefix for interface name
56+
* [interfaced/singular-enum](docs/rules/singular-enum.md) - enforce enum name to be singular
57+
58+
### Stylistic issues
59+
60+
* [interfaced/lines-around-class](docs/rules/lines-around-class.md) - enforce newlines before and after class
61+
* [interfaced/lines-between-methods](docs/rules/lines-between-methods.md) - enforce newlines between methods
62+
* [interfaced/lines-between-props](docs/rules/lines-between-props.md) - enforce newlines between properties
63+
* [interfaced/methods-order](docs/rules/methods-order.md) - enforce the specified order for methods
64+
* [interfaced/props-order](docs/rules/props-order.md) - enforce the specified order for properties
65+
* [interfaced/typecast-spacing](docs/rules/typecast-spacing.md) - enforce spacing in typecast (JSDoc + parenthesis)
66+
67+
### Other
68+
69+
* [interfaced/no-empty-method](docs/rules/no-empty-method.md) - disallow empty methods when class is neither abstract, interface nor record
70+
* [interfaced/no-public-underscore](docs/rules/no-public-underscore.md) - disallow methods and properties with name that starts from "_" without private/protected access modifier
71+
* [interfaced/prevent-unused-meta-params](docs/rules/prevent-unused-meta-params.md) - prevent interface, record, abstract or overriding method params to be marked as unused
72+
73+
### Redefined
74+
75+
Some useful rules provided by ESLint are slightly inappropriate for our environment, so we redefine them with some adjusting:
6776

6877
* [interfaced/camelcase](docs/redefined/camelcase.md)
6978
* [interfaced/no-param-reassign](docs/redefined/no-param-reassign.md)

docs/rules/event-const-value.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# interfaced/event-const-value
22

3-
Enforce event constant value to be a lowercase latinic string with dash sign delimiter.
3+
Enforce event constant value to be a lowercase latin string with dash sign delimiter.
44

55
## Resources
66

docs/rules/jsdoc-type-application-dot.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# interfaced/jsdoc-type-application-dot
22

3-
Enforce dot before `<` symbol in JSDoc type application.
3+
Enforce dot before "<" symbol in JSDoc type application.
44

55
**Fixable:** this rule is automatically fixable by `--fix`.
66

docs/rules/lines-between-statics.md

Lines changed: 0 additions & 22 deletions
This file was deleted.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# interfaced/no-jsdoc-type-multi-spaces
2+
3+
Disallow multiple spaces in JSDoc type.
4+
5+
**Fixable:** this rule is automatically fixable by `--fix`.
6+
7+
## Examples
8+
9+
**Correct** code for this rule:
10+
11+
```js
12+
/**
13+
* @type {string | number}
14+
*/
15+
```
16+
17+
**Incorrect** code for this rule:
18+
19+
```js
20+
/**
21+
* @enum {string | number}
22+
*/
23+
```
24+
25+
## Resources
26+
27+
* [Source](../../lib/rules/no-jsdoc-type-multi-spaces.js)
28+
* [Tests](../../test/eslint/rules/no-jsdoc-type-multi-spaces.js)

docs/rules/no-jsdoc-type-tabs.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# interfaced/no-jsdoc-type-tabs
2+
3+
Disallow tab characters in JSDoc type.
4+
5+
## Examples
6+
7+
**Correct** code for this rule:
8+
9+
```js
10+
/**
11+
* @type {{
12+
* key: number
13+
*}}
14+
*/
15+
```
16+
17+
**Incorrect** code for this rule:
18+
19+
```js
20+
/**
21+
* @type {{
22+
* \t key: number
23+
* }}
24+
*/
25+
```
26+
27+
## Resources
28+
29+
* [Source](../../lib/rules/no-jsdoc-type-tabs.js)
30+
* [Tests](../../test/eslint/rules/no-jsdoc-type-tabs.js)

docs/rules/no-public-underscore.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# interfaced/no-public-underscore
22

3-
Disallow methods and properties with name that starts from `_` without `private`/`protected` access modifier.
3+
Disallow methods and properties with name that starts from "_" without private/protected access modifier.
44

55
## Resources
66

docs/rules/no-tabs-in-jsdoc-type.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)