eslint-config-seek 7.0.7 → 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.
- package/.changeset/README.md +8 -0
- package/.changeset/changelog.js +162 -0
- package/.changeset/config.json +10 -0
- package/.eslintrc.js +4 -10
- package/.github/workflows/release.yml +34 -0
- package/.github/workflows/test.yml +26 -0
- package/CHANGELOG.md +21 -0
- package/README.md +2 -2
- package/package.json +8 -28
- package/.travis.yml +0 -15
|
@@ -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
|
@@ -53,7 +53,6 @@ const baseRules = {
|
|
|
53
53
|
ERROR,
|
|
54
54
|
{ argsIgnorePattern: '^_', ignoreRestSiblings: true },
|
|
55
55
|
],
|
|
56
|
-
'no-use-before-define': [ERROR, { functions: false }],
|
|
57
56
|
'handle-callback-err': ERROR,
|
|
58
57
|
'no-new-require': ERROR,
|
|
59
58
|
'no-path-concat': ERROR,
|
|
@@ -98,15 +97,11 @@ const baseConfig = {
|
|
|
98
97
|
},
|
|
99
98
|
settings: {
|
|
100
99
|
react: {
|
|
101
|
-
version: '
|
|
100
|
+
version: 'detect',
|
|
102
101
|
},
|
|
103
102
|
},
|
|
104
|
-
plugins: ['react', 'react-hooks'
|
|
105
|
-
extends: [
|
|
106
|
-
'plugin:css-modules/recommended',
|
|
107
|
-
'plugin:react/recommended',
|
|
108
|
-
'prettier',
|
|
109
|
-
],
|
|
103
|
+
plugins: ['react', 'react-hooks'],
|
|
104
|
+
extends: ['plugin:react/recommended', 'prettier'],
|
|
110
105
|
rules: {
|
|
111
106
|
...baseRules,
|
|
112
107
|
...reactRules,
|
|
@@ -160,7 +155,6 @@ const baseConfig = {
|
|
|
160
155
|
es6: true,
|
|
161
156
|
},
|
|
162
157
|
extends: [
|
|
163
|
-
'plugin:flowtype/recommended',
|
|
164
158
|
'plugin:import/errors',
|
|
165
159
|
'plugin:import/warnings',
|
|
166
160
|
'plugin:import/typescript',
|
|
@@ -172,8 +166,8 @@ const baseConfig = {
|
|
|
172
166
|
},
|
|
173
167
|
},
|
|
174
168
|
},
|
|
175
|
-
plugins: ['flowtype'],
|
|
176
169
|
rules: {
|
|
170
|
+
'no-use-before-define': [ERROR, { functions: false }],
|
|
177
171
|
'no-unused-expressions': ERROR,
|
|
178
172
|
'import/no-unresolved': [
|
|
179
173
|
ERROR,
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- beta
|
|
7
|
+
- master
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
release:
|
|
11
|
+
name: Release
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
env:
|
|
14
|
+
CI: true
|
|
15
|
+
steps:
|
|
16
|
+
- name: Check out repo
|
|
17
|
+
uses: actions/checkout@main
|
|
18
|
+
|
|
19
|
+
- name: Set up Node.js 16.x
|
|
20
|
+
uses: actions/setup-node@main
|
|
21
|
+
with:
|
|
22
|
+
node-version: 16.x
|
|
23
|
+
|
|
24
|
+
- name: Install dependencies
|
|
25
|
+
run: yarn --immutable
|
|
26
|
+
|
|
27
|
+
- name: Release
|
|
28
|
+
uses: changesets/action@v1
|
|
29
|
+
with:
|
|
30
|
+
publish: yarn release
|
|
31
|
+
version: yarn changeset-version
|
|
32
|
+
env:
|
|
33
|
+
GITHUB_TOKEN: ${{ secrets.SEEK_OSS_CI_GITHUB_TOKEN }}
|
|
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,5 +1,5 @@
|
|
|
1
|
-
[](https://github.com/seek-oss/eslint-config-seek/actions/workflows/test.yml)
|
|
2
|
+
[](https://github.com/seek-oss/eslint-config-seek/actions/workflows/release.yml)
|
|
3
3
|
|
|
4
4
|
# eslint-config-seek
|
|
5
5
|
|
package/package.json
CHANGED
|
@@ -1,27 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-config-seek",
|
|
3
|
-
"version": "
|
|
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": "
|
|
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
|
-
"
|
|
18
|
-
"travis-deploy-once": "travis-deploy-once",
|
|
19
|
-
"semantic-release": "semantic-release"
|
|
20
|
-
},
|
|
21
|
-
"husky": {
|
|
22
|
-
"hooks": {
|
|
23
|
-
"commit-msg": "commitlint --edit --extends seek"
|
|
24
|
-
}
|
|
18
|
+
"changeset-version": "changeset version && prettier --write ."
|
|
25
19
|
},
|
|
26
20
|
"homepage": "https://github.com/seek-oss/eslint-config-seek#readme",
|
|
27
21
|
"dependencies": {
|
|
@@ -30,36 +24,22 @@
|
|
|
30
24
|
"babel-eslint": "^10.1.0",
|
|
31
25
|
"eslint-config-prettier": "^6.11.0",
|
|
32
26
|
"eslint-import-resolver-node": "^0.3.3",
|
|
33
|
-
"eslint-plugin-css-modules": "^2.11.0",
|
|
34
27
|
"eslint-plugin-cypress": "^2.11.1",
|
|
35
|
-
"eslint-plugin-flowtype": "^5.1.3",
|
|
36
28
|
"eslint-plugin-import": "^2.21.2",
|
|
37
|
-
"eslint-plugin-jest": "^
|
|
29
|
+
"eslint-plugin-jest": "^25.2.2",
|
|
38
30
|
"eslint-plugin-react": "^7.20.0",
|
|
39
31
|
"eslint-plugin-react-hooks": "^4.0.4",
|
|
40
32
|
"find-root": "^1.1.0"
|
|
41
33
|
},
|
|
42
34
|
"devDependencies": {
|
|
43
|
-
"@
|
|
44
|
-
"
|
|
45
|
-
"commitlint-config-seek": "^1.0.0",
|
|
46
|
-
"cz-conventional-changelog": "^3.0.2",
|
|
35
|
+
"@changesets/cli": "2.17.0",
|
|
36
|
+
"@changesets/get-github-info": "0.5.0",
|
|
47
37
|
"eslint": "^7.14.0",
|
|
48
|
-
"
|
|
49
|
-
"semantic-release": "^15.13.31",
|
|
50
|
-
"travis-deploy-once": "^5.0.11",
|
|
38
|
+
"prettier": "2.4.1",
|
|
51
39
|
"typescript": "^4.1.2"
|
|
52
40
|
},
|
|
53
|
-
"release": {
|
|
54
|
-
"success": false
|
|
55
|
-
},
|
|
56
41
|
"peerDependencies": {
|
|
57
42
|
"eslint": ">=6",
|
|
58
43
|
"typescript": ">=3.3"
|
|
59
|
-
},
|
|
60
|
-
"config": {
|
|
61
|
-
"commitizen": {
|
|
62
|
-
"path": "./node_modules/cz-conventional-changelog"
|
|
63
|
-
}
|
|
64
44
|
}
|
|
65
45
|
}
|
package/.travis.yml
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
language: node_js
|
|
2
|
-
cache:
|
|
3
|
-
directories:
|
|
4
|
-
- node_modules
|
|
5
|
-
notifications:
|
|
6
|
-
email: false
|
|
7
|
-
node_js:
|
|
8
|
-
- '10'
|
|
9
|
-
before_script:
|
|
10
|
-
- npm prune
|
|
11
|
-
after_success:
|
|
12
|
-
- npm run travis-deploy-once "npm run semantic-release"
|
|
13
|
-
branches:
|
|
14
|
-
except:
|
|
15
|
-
- /^v\d+\.\d+\.\d+$/
|