eslint-config-seek 7.0.9 → 8.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,8 @@
1
+ # Changesets
2
+
3
+ Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4
+ with multi-package repos, or single-package repos to help you version and publish your code. You can
5
+ find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6
+
7
+ We have a quick list of common questions to get you started engaging with this project in
8
+ [our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
@@ -0,0 +1,162 @@
1
+ const {
2
+ getInfo,
3
+ getInfoFromPullRequest,
4
+ } = require('@changesets/get-github-info');
5
+
6
+ /**
7
+ * Adapted from `@changesets/cli`.
8
+ *
9
+ * {@link https://github.com/atlassian/changesets/blob/%40changesets/cli%402.17.0/packages/cli/src/changelog/index.ts}
10
+ *
11
+ * @type import('@changesets/types').ChangelogFunctions
12
+ */
13
+ const defaultChangelogFunctions = {
14
+ getDependencyReleaseLine: async (changesets, dependenciesUpdated) => {
15
+ if (dependenciesUpdated.length === 0) return '';
16
+
17
+ const changesetLinks = changesets.map(
18
+ (changeset) => `- Updated dependencies [${changeset.commit}]`,
19
+ );
20
+
21
+ const updatedDependenciesList = dependenciesUpdated.map(
22
+ (dependency) => ` - ${dependency.name}@${dependency.newVersion}`,
23
+ );
24
+
25
+ return [...changesetLinks, ...updatedDependenciesList].join('\n');
26
+ },
27
+ getReleaseLine: async (changeset) => {
28
+ const [firstLine, ...futureLines] = changeset.summary
29
+ .split('\n')
30
+ .map((l) => l.trimRight());
31
+
32
+ const suffix = changeset.commit;
33
+
34
+ return `\n\n- ${firstLine}${suffix ? ` (${suffix})` : ''}\n${futureLines
35
+ .map((l) => ` ${l}`)
36
+ .join('\n')}`;
37
+ },
38
+ };
39
+
40
+ /**
41
+ * Adapted from `@changesets/changelog-github`.
42
+ *
43
+ * {@link https://github.com/atlassian/changesets/blob/%40changesets/changelog-github%400.4.1/packages/changelog-github/src/index.ts}
44
+ *
45
+ * @type import('@changesets/types').ChangelogFunctions
46
+ */
47
+ const gitHubChangelogFunctions = {
48
+ getDependencyReleaseLine: async (
49
+ changesets,
50
+ dependenciesUpdated,
51
+ options,
52
+ ) => {
53
+ if (!options.repo) {
54
+ throw new Error(
55
+ 'Please provide a repo to this changelog generator like this:\n"changelog": ["./changelog.js", { "repo": "org/repo" }]',
56
+ );
57
+ }
58
+ if (dependenciesUpdated.length === 0) return '';
59
+
60
+ const changesetLink = `- Updated dependencies [${(
61
+ await Promise.all(
62
+ changesets.map(async (cs) => {
63
+ if (cs.commit) {
64
+ let { links } = await getInfo({
65
+ repo: options.repo,
66
+ commit: cs.commit,
67
+ });
68
+ return links.commit;
69
+ }
70
+ }),
71
+ )
72
+ )
73
+ .filter((_) => _)
74
+ .join(', ')}]:`;
75
+
76
+ const updatedDependenciesList = dependenciesUpdated.map(
77
+ (dependency) => ` - ${dependency.name}@${dependency.newVersion}`,
78
+ );
79
+
80
+ return [changesetLink, ...updatedDependenciesList].join('\n');
81
+ },
82
+ getReleaseLine: async (changeset, _type, options) => {
83
+ if (!options || !options.repo) {
84
+ throw new Error(
85
+ 'Please provide a repo to this changelog generator like this:\n"changelog": ["./changelog.js", { "repo": "org/repo" }]',
86
+ );
87
+ }
88
+
89
+ /** @type number | undefined */
90
+ let prFromSummary;
91
+ /** @type string | undefined */
92
+ let commitFromSummary;
93
+
94
+ const replacedChangelog = changeset.summary
95
+ .replace(/^\s*(?:pr|pull|pull\s+request):\s*#?(\d+)/im, (_, pr) => {
96
+ let num = Number(pr);
97
+ if (!isNaN(num)) prFromSummary = num;
98
+ return '';
99
+ })
100
+ .replace(/^\s*commit:\s*([^\s]+)/im, (_, commit) => {
101
+ commitFromSummary = commit;
102
+ return '';
103
+ })
104
+ .replace(/^\s*(?:author|user):\s*@?([^\s]+)/gim, (_, user) => {
105
+ usersFromSummary.push(user);
106
+ return '';
107
+ })
108
+ .trim();
109
+
110
+ const [firstLine, ...futureLines] = replacedChangelog
111
+ .split('\n')
112
+ .map((l) => l.trimRight());
113
+
114
+ const links = await (async () => {
115
+ if (prFromSummary !== undefined) {
116
+ let { links } = await getInfoFromPullRequest({
117
+ repo: options.repo,
118
+ pull: prFromSummary,
119
+ });
120
+ if (commitFromSummary) {
121
+ links = {
122
+ ...links,
123
+ commit: `[\`${commitFromSummary}\`](https://github.com/${options.repo}/commit/${commitFromSummary})`,
124
+ };
125
+ }
126
+ return links;
127
+ }
128
+ const commitToFetchFrom = commitFromSummary || changeset.commit;
129
+ if (commitToFetchFrom) {
130
+ let { links } = await getInfo({
131
+ repo: options.repo,
132
+ commit: commitToFetchFrom,
133
+ });
134
+ return links;
135
+ }
136
+ return {
137
+ commit: null,
138
+ pull: null,
139
+ user: null,
140
+ };
141
+ })();
142
+
143
+ const suffix = links.pull ?? links.commit;
144
+
145
+ return [
146
+ `\n- ${firstLine}${suffix ? ` (${suffix})` : ''}`,
147
+ ...futureLines.map((l) => ` ${l}`),
148
+ ].join('\n');
149
+ },
150
+ };
151
+
152
+ if (process.env.GITHUB_TOKEN) {
153
+ module.exports = gitHubChangelogFunctions;
154
+ } else {
155
+ console.warn(
156
+ `Defaulting to Git-based versioning.
157
+ Enable GitHub-based versioning by setting the GITHUB_TOKEN environment variable.
158
+ This requires a GitHub personal access token with the \`public_repo\` scope: https://github.com/settings/tokens/new`,
159
+ );
160
+
161
+ module.exports = defaultChangelogFunctions;
162
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "$schema": "https://unpkg.com/@changesets/config@1.6.1/schema.json",
3
+ "changelog": ["./changelog.js", { "repo": "seek-oss/eslint-config-seek" }],
4
+ "commit": false,
5
+ "linked": [],
6
+ "access": "public",
7
+ "baseBranch": "master",
8
+ "updateInternalDependencies": "patch",
9
+ "ignore": []
10
+ }
package/.eslintrc.js CHANGED
@@ -97,15 +97,11 @@ const baseConfig = {
97
97
  },
98
98
  settings: {
99
99
  react: {
100
- version: '>16',
100
+ version: 'detect',
101
101
  },
102
102
  },
103
- plugins: ['react', 'react-hooks', 'css-modules'],
104
- extends: [
105
- 'plugin:css-modules/recommended',
106
- 'plugin:react/recommended',
107
- 'prettier',
108
- ],
103
+ plugins: ['react', 'react-hooks'],
104
+ extends: ['plugin:react/recommended', 'prettier'],
109
105
  rules: {
110
106
  ...baseRules,
111
107
  ...reactRules,
@@ -159,7 +155,6 @@ const baseConfig = {
159
155
  es6: true,
160
156
  },
161
157
  extends: [
162
- 'plugin:flowtype/recommended',
163
158
  'plugin:import/errors',
164
159
  'plugin:import/warnings',
165
160
  'plugin:import/typescript',
@@ -171,7 +166,6 @@ const baseConfig = {
171
166
  },
172
167
  },
173
168
  },
174
- plugins: ['flowtype'],
175
169
  rules: {
176
170
  'no-use-before-define': [ERROR, { functions: false }],
177
171
  'no-unused-expressions': ERROR,
@@ -1,34 +1,34 @@
1
- name: Test & Release
1
+ name: Release
2
2
 
3
3
  on:
4
- - pull_request
5
- - push
4
+ push:
5
+ branches:
6
+ - beta
7
+ - master
6
8
 
7
9
  jobs:
8
- test-and-release:
9
- name: Test & Release
10
+ release:
11
+ name: Release
10
12
  runs-on: ubuntu-latest
11
13
  env:
12
14
  CI: true
13
15
  steps:
14
16
  - name: Check out repo
15
17
  uses: actions/checkout@main
16
- with:
17
- lfs: true
18
18
 
19
- - name: Set up Node.js 14.x
19
+ - name: Set up Node.js 16.x
20
20
  uses: actions/setup-node@main
21
21
  with:
22
- node-version: 14.x
22
+ node-version: 16.x
23
23
 
24
24
  - name: Install dependencies
25
25
  run: yarn --immutable
26
26
 
27
- - name: Test
28
- run: yarn test
29
-
30
27
  - name: Release
31
- run: yarn release
28
+ uses: changesets/action@v1
29
+ with:
30
+ publish: yarn release
31
+ version: yarn changeset-version
32
32
  env:
33
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33
+ GITHUB_TOKEN: ${{ secrets.SEEK_OSS_CI_GITHUB_TOKEN }}
34
34
  NPM_TOKEN: ${{ secrets.SEEK_OSS_CI_NPM_TOKEN }}
@@ -0,0 +1,26 @@
1
+ name: Test
2
+
3
+ on:
4
+ - pull_request
5
+ - push
6
+
7
+ jobs:
8
+ test:
9
+ name: Test
10
+ runs-on: ubuntu-latest
11
+ env:
12
+ CI: true
13
+ steps:
14
+ - name: Check out repo
15
+ uses: actions/checkout@main
16
+
17
+ - name: Set up Node.js 16.x
18
+ uses: actions/setup-node@main
19
+ with:
20
+ node-version: 16.x
21
+
22
+ - name: Install dependencies
23
+ run: yarn --immutable
24
+
25
+ - name: Test
26
+ run: yarn test
package/CHANGELOG.md ADDED
@@ -0,0 +1,21 @@
1
+ # eslint-config-seek
2
+
3
+ ## 8.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - Remove support for Flow ([#64](https://github.com/seek-oss/eslint-config-seek/pull/64))
8
+
9
+ SEEK has aligned on [TypeScript](https://www.typescriptlang.org/) for static type checking. [Flow](https://flow.org/) support was similarly removed in [sku 11](https://github.com/seek-oss/sku/releases/tag/v11.0.0).
10
+
11
+ Affected projects should migrate to TypeScript.
12
+
13
+ - Remove support for CSS Modules ([#64](https://github.com/seek-oss/eslint-config-seek/pull/64))
14
+
15
+ [eslint-plugin-css-modules](https://github.com/atfzl/eslint-plugin-css-modules) is unmaintained, and SEEK has since moved on to [vanilla-extract](https://vanilla-extract.style/).
16
+
17
+ Affected projects should migrate to vanilla-extract.
18
+
19
+ ### Patch Changes
20
+
21
+ - Detect the react version ([#68](https://github.com/seek-oss/eslint-config-seek/pull/68))
package/README.md CHANGED
@@ -1,4 +1,5 @@
1
- [![Test & Release](https://github.com/seek-oss/eslint-config-seek/actions/workflows/test-and-release.yml/badge.svg)](https://github.com/seek-oss/eslint-config-seek/actions/workflows/test-and-release.yml)
1
+ [![Test](https://github.com/seek-oss/eslint-config-seek/actions/workflows/test.yml/badge.svg)](https://github.com/seek-oss/eslint-config-seek/actions/workflows/test.yml)
2
+ [![Release](https://github.com/seek-oss/eslint-config-seek/actions/workflows/release.yml/badge.svg)](https://github.com/seek-oss/eslint-config-seek/actions/workflows/release.yml)
2
3
 
3
4
  # eslint-config-seek
4
5
 
package/package.json CHANGED
@@ -1,26 +1,21 @@
1
1
  {
2
2
  "name": "eslint-config-seek",
3
- "version": "7.0.9",
3
+ "version": "8.0.0",
4
4
  "description": "ESLint configuration used by SEEK",
5
5
  "main": ".eslintrc.js",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/seek-oss/eslint-config-seek.git"
9
9
  },
10
- "author": "Seek",
10
+ "author": "SEEK",
11
11
  "license": "MIT",
12
12
  "bugs": {
13
13
  "url": "https://github.com/seek-oss/eslint-config-seek/issues"
14
14
  },
15
15
  "scripts": {
16
+ "release": "changeset publish",
16
17
  "test": "eslint .",
17
- "commit": "git-cz",
18
- "release": "semantic-release"
19
- },
20
- "husky": {
21
- "hooks": {
22
- "commit-msg": "commitlint --edit --extends seek"
23
- }
18
+ "changeset-version": "changeset version && prettier --write ."
24
19
  },
25
20
  "homepage": "https://github.com/seek-oss/eslint-config-seek#readme",
26
21
  "dependencies": {
@@ -29,9 +24,7 @@
29
24
  "babel-eslint": "^10.1.0",
30
25
  "eslint-config-prettier": "^6.11.0",
31
26
  "eslint-import-resolver-node": "^0.3.3",
32
- "eslint-plugin-css-modules": "^2.11.0",
33
27
  "eslint-plugin-cypress": "^2.11.1",
34
- "eslint-plugin-flowtype": "^5.1.3",
35
28
  "eslint-plugin-import": "^2.21.2",
36
29
  "eslint-plugin-jest": "^25.2.2",
37
30
  "eslint-plugin-react": "^7.20.0",
@@ -39,25 +32,14 @@
39
32
  "find-root": "^1.1.0"
40
33
  },
41
34
  "devDependencies": {
42
- "@commitlint/cli": "^8.2.0",
43
- "commitizen": "^4.0.3",
44
- "commitlint-config-seek": "^1.0.0",
45
- "cz-conventional-changelog": "^3.0.2",
35
+ "@changesets/cli": "2.17.0",
36
+ "@changesets/get-github-info": "0.5.0",
46
37
  "eslint": "^7.14.0",
47
- "husky": "^3.1.0",
48
- "semantic-release": "^15.13.31",
38
+ "prettier": "2.4.1",
49
39
  "typescript": "^4.1.2"
50
40
  },
51
- "release": {
52
- "success": false
53
- },
54
41
  "peerDependencies": {
55
42
  "eslint": ">=6",
56
43
  "typescript": ">=3.3"
57
- },
58
- "config": {
59
- "commitizen": {
60
- "path": "./node_modules/cz-conventional-changelog"
61
- }
62
44
  }
63
45
  }