Skip to content

Commit 9748443

Browse files
authored
Merge pull request #13 from shlinkio/feature/extra-rules
Feature/extra rules
2 parents 8db2bd1 + ae93a2a commit 9748443

File tree

6 files changed

+492
-243
lines changed

6 files changed

+492
-243
lines changed

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,25 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org).
66

7+
## [2.1.0] - 2023-02-18
8+
#### Added
9+
* [#10](https://github.com/shlinkio/js-coding-standard/issues/10) Enforce `import type` whenever possible.
10+
* [#11](https://github.com/shlinkio/js-coding-standard/issues/11) Enforce ordering imports alphabetically.
11+
* [#12](https://github.com/shlinkio/js-coding-standard/issues/12) Ban export default.
12+
13+
#### Changed
14+
* *Nothing*
15+
16+
#### Deprecated
17+
* *Nothing*
18+
19+
#### Removed
20+
* *Nothing*
21+
22+
#### Fixed
23+
* *Nothing*
24+
25+
726
## [2.0.2] - 2022-05-12
827
#### Added
928
* Added automation publishing pipeline

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
[![GitHub license](https://img.shields.io/github/license/shlinkio/js-coding-standard.svg?style=flat-square)](https://github.com/shlinkio/js-coding-standard/blob/master/LICENSE)
66
[![Paypal Donate](https://img.shields.io/badge/Donate-paypal-blue.svg?style=flat-square&logo=paypal&colorA=cccccc)](https://acel.me/donate)
77

8-
Coding standard used by shlink JavaScript projects.
8+
Coding standard used by Shlink JavaScript projects.

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ version: '3'
33
services:
44
shlink_js_coding_standard_node:
55
container_name: shlink_js_coding_standard_node
6-
image: node:16.14-alpine
6+
image: node:18.14-alpine
77
volumes:
88
- ./:/home/shlink

index.js

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,34 @@ module.exports = {
44
'airbnb-typescript',
55
'plugin:@typescript-eslint/recommended'
66
],
7+
plugins: ['simple-import-sort'],
78
rules: {
8-
'object-curly-newline': 'off',
9-
'implicit-arrow-linebreak': 'off',
10-
'no-restricted-globals': 'off',
11-
'default-case': 'off',
9+
// Customize rules or add on top of presets
1210
'max-len': [
1311
'error',
1412
{ 'code': 120, 'ignoreComments': true, 'ignoreStrings': true, 'ignoreTemplateLiterals': true },
1513
],
14+
'@typescript-eslint/consistent-type-imports': 'error',
15+
'simple-import-sort/imports': ['error', {
16+
'groups': [
17+
['^', '^\\.', '\\.s?css$']
18+
]
19+
}],
20+
'no-restricted-exports': ['error', {
21+
'restrictDefaultExports': {
22+
'direct': true,
23+
'named': true,
24+
'defaultFrom': true,
25+
'namedFrom': true,
26+
'namespaceFrom': true
27+
}
28+
}],
29+
30+
// Disabled rules from presets
31+
'object-curly-newline': 'off',
32+
'implicit-arrow-linebreak': 'off',
33+
'no-restricted-globals': 'off',
34+
'default-case': 'off',
1635
'import/no-cycle': 'off',
1736
'import/prefer-default-export': 'off',
1837
'import/no-extraneous-dependencies': 'off',

0 commit comments

Comments
 (0)