包详细信息

wttj-config

WTTJ1.9kISC3.1.5

Front-end code lint and formatting config

eslint, eslintconfig, prettier, prettierconfig

自述文件

wttj-config

Install

yarn add --dev wttj-config

Eslint

// .eslintrc.js
module.exports = {
  extends: './node_modules/wttj-config/lib/eslint',
  // or if you want typescript configuration
  // extends: './node_modules/wttj-config/lib/eslint/eslintrc-typescript',
  // or if you want cypress configuration
  // extends: './node_modules/wttj-config/lib/eslint/eslintrc-cypress',
}

Prettier

// prettier.config.js
module.exports = require('wttj-config/lib/prettier')

Stylelint

// stylelint.config.js
module.exports = {
  extends: './node_modules/wttj-config/lib/stylelint',
}

Tsconfig

// tsconfig.json
{
  "extends": "wttj-config/lib/tsconfig/tsconfig.json",
  "compilerOptions": {
    "baseUrl": "src"
  },
  "include": ["src"]
}

Translations

We've added a script to run as a lint task that ensures that the keys in translation files are sorted alphabetically.

Scripts

// package.json
{
  "scripts": {
    // ...
    "lint": "yarn lint:js && yarn lint:css && yarn lint:ts && yarn lint:translations",
    "lint:js": "eslint src --max-warnings 0",
    "lint:css": "stylelint 'src/**/styles.ts' --allow-empty-input",
    "lint:ts": "tsc --noEmit",
    "lint:translations": "node -r esm scripts/sort-translations.js",
  }
},

VSCode

Install eslint and prettier extensions

// your settings.json
{
  "editor.formatOnSave": true,
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
  },
  "editor.defaultFormatter": "esbenp.prettier-vscode"
}

How to release

yarn release

Then release-it create a new github tag who activate circle ci release action.

更新日志

Changelog

All notable changes to this project will be documented in this file. Dates are displayed in UTC.

Generated by auto-changelog.

3.1.5

  • chore: update README and js gardening 37c9dcf

3.1.4

14 May 2025

3.1.4-beta.1

14 May 2025

  • fix: add test on git command fail 1dd46d2
  • fix: add tests on precommit hook code eb53763
  • chore: release v3.1.4-beta.1 1b7e6b8

3.1.4-beta.0

28 April 2025

  • chore(conf): configure tests and improve i18n tooling #285
  • chore: release v3.1.4-beta.0 f2bad17
  • fix: precommit hook not seeing diffs when path to ignore set f83a17b

3.1.3

14 April 2025

3.1.3-beta.1

10 April 2025

  • chore: release v3.1.3-beta.1 164aa8a
  • fix: precommit hook import wrong file name ccde5ec

3.1.3-beta.0

10 April 2025

  • chore: update yarn audit [FRO-13] #281
  • Fix(i18n): extend regex to handle optional id prefix #280
  • fix: precommit no ignoring path_to_ignore option #279
  • chore: replace jest with vitest and adapt test code b54a38d
  • chore: merge check and sync utils d373e57
  • chore: add conf for vitest and mock fs with memfs 91d15bc

3.1.2

21 February 2025

3.1.2-0

21 February 2025

  • Fix GitHub url for context #278
  • chore: release v3.1.2-0 ee658e3
  • fix: precommit no ignoring path_to_ignore option 25b28e9

3.1.1

20 February 2025

  • style: update i18n README #277
  • chore: update i18n setup doc #276
  • [PLA-70] Add i18n config #275
  • chore: release v3.1.1 e550355
  • fix: encode id in github url 25b1949
  • fix: remove --silent option in scripts because not supported by yarn v4 a36dfe6

3.1.0

4 February 2025

  • chore: update README db75527
  • chore: update README with circle ci conf for lokalise update automation e9ce295
  • chore: release v3.1.0 d5806df

3.1.0-8

31 January 2025

  • chore: rewrite precommit hook in node and remove env variables eda4fc9
  • chore: release v3.1.0-8 228d1bd

3.1.0-7

29 January 2025

  • fix: broken secrets file for i18n ab4f282
  • chore: release v3.1.0-7 2aad37c
  • fix: i18n-env file path 89448fd

3.1.0-6

29 January 2025

  • chore: update README with secrets for lokalise cli d03dabe
  • fix: update readme 1f4f7f7
  • chore: release v3.1.0-6 ed36e53

3.1.0-5

29 January 2025

  • chore: add README first iteration 78f351c
  • chore: release v3.1.0-5 40add42

3.1.0-4

29 January 2025

  • chore: release v3.1.0-4 3329a09
  • fix: correct file name for sync-utils script 87b9bfa

3.1.0-3

29 January 2025

  • chore: release v3.1.0-3 3b2eee3
  • fix: precommit check file path c200f7b

3.1.0-2

29 January 2025

  • chore: release v3.1.0-2 79616bd
  • fix: add executable rights on precommit shell script 9da2643

3.1.0-1

29 January 2025

  • chore: add precommit hook for i18n 351e718
  • chore: release v3.1.0-1 878bda4

3.1.0-0

29 January 2025

3.0.1

13 June 2024

3.0.0

7 March 2024

  • chore: upgrade dependencies and add typescript-sort-keys #217
  • chore: release v3.0.0 51d18d4

3.0.0-beta.0

6 March 2024

  • chore: fix yarn lock and prettier 0f0c655
  • chore: upgrade minor - fixes dependencies 8607560
  • chore: upgrade release-it 43cfab7

2.8.0

17 October 2023

  • core: upgrade stylelint and use latest associated configs #215
  • ci: add contexts instead of variable #213
  • chore: release v2.8.0 e14a5d2
  • Update config.yml 8eb588d

2.7.3

5 September 2023

2.7.2

5 September 2023

2.7.1

5 September 2023

  • fix: circle ci release #211
  • fix: lokalize sort keys #210
  • ci: add npm release on new tag #209
  • refactor: add function from jsonabc 822eaf9
  • chore: release v2.7.1 3e13d4c
  • Update config.yml b079f7a

2.6.2

24 August 2023

  • chore: remove prefer-read-only-props rule #207
  • chore: release v2.6.1 #204
  • chore: update sort to be like Lokalise #202
  • fix: npm audit 995cddf
  • chore: release v2.6.2 82fb0d6
  • chore: remove semver version lock e09580b

2.5.3

27 June 2023

  • fix: force semver version #193
  • chore: release v2.5.3 4f21cf3

2.5.2

27 June 2023

  • fix: vulnerabilities (semver package) #192
  • chore: release v2.5.1 #180
  • chore: release v2.5.2 2e16052

2.5.1

2 June 2023

  • fix: missing dependencies #179
  • chore: release v2.5.0 #178
  • chore: release v2.5.1 65b441c

2.5.0

2 June 2023

  • feat: add script to sort translation file keys #176
  • chore(deps): bump eslint-plugin-import from 2.26.0 to 2.27.5 #155
  • chore(deps): bump cacheable-request from 10.2.3 to 10.2.7 #160
  • chore(deps): bump eslint-config-prettier from 8.5.0 to 8.8.0 #169
  • chore(deps): bump eslint from 8.29.0 to 8.39.0 #175
  • chore(deps): bump vm2 from 3.9.17 to 3.9.19 #177
  • chore(deps): bump vm2 from 3.9.12 to 3.9.17 #174
  • ci: add parameters #168
  • chore: security audit #165
  • chore: release v2.4.5 #163
  • chore: release v2.5.0 6c9f8a7
  • Update config.yml cef873a

2.4.5

16 February 2023

  • Fix public release #162
  • chore: release v2.4.5 182d68d

2.4.5-1

15 February 2023

  • chore: release v2.4.5-1 f385f0a
  • fix: move publishConfig to package.json c91fb4e

2.4.5-0

15 February 2023

2.4.4

15 February 2023

2.4.3

26 January 2023

  • chore(deps): bump eslint-plugin-jsx-a11y from 6.6.1 to 6.7.1 #151
  • chore(deps): bump stylelint from 14.16.0 to 14.16.1 #152
  • chore(deps): bump eslint-plugin-react from 7.31.11 to 7.32.1 #153
  • fix: stylelint warnings complaining about missing customSyntax option #154
  • chore(deps): bump @typescript-eslint/eslint-plugin from 5.45.1 to 5.49.0 #148
  • chore(deps): bump json5 from 1.0.1 to 1.0.2 #141
  • chore(deps): bump prettier from 2.8.0 to 2.8.3 #145
  • chore(deps): bump @typescript-eslint/parser from 5.45.1 to 5.49.0 #149
  • chore: change package name and some urls #150
  • chore: release v2.4.3 04f3ecf

2.4.2

24 January 2023

2.4.1

24 January 2023

  • chore: rename package #129
  • chore: release v2.4.1 9d09712
  • chore: change package name and some urls 8385c15

2.4.0

7 December 2022

2.3.3

6 December 2022

2.3.3-0

24 November 2022

2.3.2

22 September 2022

  • chore(deps): bump eslint-plugin-prettier from 4.0.0 to 4.2.1 #80
  • chore(deps): bump parse-url from 6.0.0 to 6.0.5 #111
  • chore(deps): bump @typescript-eslint/eslint-plugin from 5.29.0 to 5.38.0 #112
  • chore(deps): bump @typescript-eslint/parser from 5.29.0 to 5.38.0 #113
  • Release 2.3.2 e6361f3

2.3.1

12 September 2022

  • fix: disable no-leaked-render eslint option for ts eslint #108
  • chore(deps): bump eslint-plugin-jsx-a11y from 6.5.1 to 6.6.0 #76
  • chore(deps-dev): bump release-it from 15.0.0 to 15.1.0 #74
  • chore(deps): bump eslint-plugin-react from 7.30.0 to 7.30.1 #75
  • Release 2.3.1 90cc445

2.3.0

21 June 2022

  • chore(deps): bump eslint from 8.17.0 to 8.18.0 #73
  • chore(deps): bump eslint-plugin-react-hooks from 4.5.0 to 4.6.0 #72
  • chore(deps): bump @typescript-eslint/parser from 5.27.1 to 5.29.0 #71
  • chore(deps): bump prettier from 2.6.2 to 2.7.1 #69
  • chore(deps): bump @typescript-eslint/eslint-plugin from 5.27.1 to 5.29.0 #70
  • chore(deps): bump stylelint-config-recommended from 7.0.0 to 8.0.0 #64
  • chore(deps): bump stylelint from 14.8.5 to 14.9.1 #65
  • chore(deps): bump @typescript-eslint/eslint-plugin from 5.27.0 to 5.27.1 #62
  • chore(deps): bump eslint from 8.16.0 to 8.17.0 #60
  • chore(deps): bump @typescript-eslint/parser from 5.27.0 to 5.27.1 #61
  • chore(deps): bump @typescript-eslint/parser from 5.26.0 to 5.27.0 #59
  • chore(deps): bump @babel/eslint-parser from 7.17.0 to 7.18.2 #56
  • chore(deps): bump stylelint from 14.8.4 to 14.8.5 #57
  • chore(deps): bump @typescript-eslint/eslint-plugin from 5.26.0 to 5.27.0 #58
  • chore(deps): bump @typescript-eslint/parser from 5.25.0 to 5.26.0 #54
  • chore(deps): bump stylelint from 14.8.2 to 14.8.4 #55
  • Release 2.3.0 bb955e1

2.2.0

24 May 2022

  • chore(deps): bump @typescript-eslint/eslint-plugin from 5.25.0 to 5.26.0 #52
  • chore(deps): bump eslint from 8.15.0 to 8.16.0 #51
  • feat: setup release-it #53
  • chore(deps): bump @typescript-eslint/eslint-plugin from 5.23.0 to 5.25.0 #48
  • chore(deps): bump @typescript-eslint/parser from 5.22.0 to 5.25.0 #47
  • chore(deps): bump eslint-plugin-react from 7.29.4 to 7.30.0 #49
  • chore(deps): bump @typescript-eslint/eslint-plugin from 5.21.0 to 5.23.0 #43
  • chore(deps): bump stylelint from 14.8.1 to 14.8.2 #41
  • chore(deps): bump eslint from 8.14.0 to 8.15.0 #42
  • chore(deps): bump @typescript-eslint/parser from 5.21.0 to 5.22.0 #40
  • chore(deps): bump stylelint from 14.7.1 to 14.8.1 #38
  • chore(deps): bump @typescript-eslint/parser from 5.19.0 to 5.21.0 #33
  • chore(deps): bump eslint-plugin-react-hooks from 4.4.0 to 4.5.0 #36
  • chore(deps): bump eslint from 8.13.0 to 8.14.0 #35
  • chore(deps): bump stylelint and stylelint-config-recommended #30
  • chore(deps): bump @typescript-eslint/eslint-plugin from 5.19.0 to 5.21.0 #34
  • chore(deps): bump eslint-plugin-react-hooks from 4.3.0 to 4.4.0 #24
  • chore(deps): bump @typescript-eslint/parser from 5.16.0 to 5.19.0 #29
  • chore(deps): bump prettier from 2.5.1 to 2.6.2 #27
  • chore(deps): bump eslint-plugin-react from 7.29.3 to 7.29.4 #25
  • chore(deps): bump eslint from 8.10.0 to 8.13.0 #26
  • fix: remove dangerous dependecies 723b175
  • Release 2.2.0 61e01f9

v2.1.0

13 April 2022

  • chore(deps): bump eslint-config-react-app from 7.0.0 to 7.0.1 #22
  • chore(deps): bump eslint-plugin-import from 2.25.4 to 2.26.0 #23
  • chore(deps): bump @typescript-eslint/eslint-plugin from 5.16.0 to 5.19.0 #21
  • chore: add dependabot #20
  • feat: add eslint-cypress config #19
  • chore(deps): bump minimist from 1.2.5 to 1.2.6 #18
  • chore(release): 2.1.0 a205125
  • chore: changelog for 2.0.0 096d77d
  • fix: tsconfig path must be complete 652c940

v2.0.1

5 April 2022

v2.0.0

5 April 2022

  • v2 #17
  • feat: tsconfig #15
  • chore: upgrade deps ee44aeb
  • feat: add stylelint & update README ee5fad3
  • fix: resolve typescript extensions in eslint-ts only ecb588c

v1.1.5

5 January 2021

  • chore: remove new property defaulty set after upgrading #8
  • chore(release): 1.1.4 3466148

v1.1.4

28 September 2020

v1.1.3

28 September 2020

  • chore: disable no-multi-comp & no-danger #6
  • Update CHANGELOG.md 8d99ebd
  • chore(release): 1.1.2 5a5f954

v1.1.2

27 May 2020

v1.1.1

27 May 2020

v1.1.0

20 April 2020

  • feat: change trailingComma to es5 #2
  • fix: prevent from using template litterals #1
  • docs: update readme 72d9c6a
  • chore(release): 1.0.1 7935159
  • Update .eslintrc.js 3b1000a

v1.0.1

10 October 2019

  • chore: set up npm publishing 6bc074b
  • chore: set up eslint and prettier rules 216403c
  • chore: update peer dependencies aa3d5bb