Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First cut of ESLint upgrade #1047

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions .changeset/changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ const repo = 'seek-oss/sku';

const changelogFunctions = {
getDependencyReleaseLine: async (changesets, dependenciesUpdated) => {
if (dependenciesUpdated.length === 0) return '';
if (dependenciesUpdated.length === 0) {
return '';
}

const changesetLink = `- Updated dependencies [${(
await Promise.all(
changesets.map(async (cs) => {
if (cs.commit) {
let { links } = await getInfo({
const { links } = await getInfo({
repo,
commit: cs.commit,
});
Expand All @@ -37,7 +39,7 @@ const changelogFunctions = {
.map((l) => l.trimRight());

if (changeset.commit) {
let { links } = await getInfo({
const { links } = await getInfo({
repo,
commit: changeset.commit,
});
Expand All @@ -47,11 +49,8 @@ const changelogFunctions = {
const summary = `- ${firstLine} (${versionInfo})`;

return `${summary}\n${futureLines.map((l) => ` ${l}`).join('\n')}`;
} else {
return `\n\n- ${firstLine}\n${futureLines
.map((l) => ` ${l}`)
.join('\n')}`;
}
return `\n\n- ${firstLine}\n${futureLines.map((l) => ` ${l}`).join('\n')}`;
},
};

Expand Down
12 changes: 0 additions & 12 deletions .eslintignore

This file was deleted.

74 changes: 0 additions & 74 deletions .eslintrc.js

This file was deleted.

3 changes: 1 addition & 2 deletions docs/deploy-docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const GITHUB_TOKEN = process.env.GITHUB_TOKEN;
const tokenRegex = GITHUB_TOKEN ? new RegExp(GITHUB_TOKEN, 'g') : null;

const log = function (message) {
// eslint-disable-next-line no-console
console.log(
tokenRegex ? message.replace(tokenRegex, '[GITHUB_TOKEN]') : message,
);
Expand All @@ -26,7 +25,7 @@ ghpages.publish('.', makeConfig(), function (err) {
if (err) {
log('Deployment error');
log(JSON.stringify(err));
// eslint-disable-next-line no-process-exit

process.exit(1);
} else {
log('Deployment complete!');
Expand Down
112 changes: 112 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
const seek = require('eslint-config-seek');
const jsdoc = require('eslint-plugin-jsdoc');
const unicorn = require('eslint-plugin-unicorn');
const globals = require('globals');

module.exports = [
{
ignores: [
'**/*.less.d.ts',
'**/node_modules',
'**/coverage/',
'**/dist/',
'**/dist-build/',
'**/dist-start/',
'**/storybook-static/',
'**/report/',
'**/template/',
'test/test-cases/*/*',
'!test/test-cases/*/*.test.js',
'fixtures/*/*',
],
},
...seek,
{
plugins: {
jsdoc,
unicorn,
},

languageOptions: {
globals: {
__SKU_SRC_PATHS_0__: true,
__SKU_SRC_PATHS_1__: true,
__SKU_SRC_PATHS_2__: true,
__SKU_SRC_PATHS_3__: true,
__SKU_SRC_PATHS_4__: true,
__SKU_SRC_PATHS_5__: true,
__SKU_SRC_PATHS_6__: true,
__SKU_SRC_PATHS_7__: true,
__SKU_SRC_PATHS_8__: true,
__SKU_SRC_PATHS_9__: true,
__SKU_CLIENT_PATH__: true,
__SKU_PUBLIC_PATH__: true,
__SKU_CSP__: true,
__SKU_DEV_HTTPS__: true,
__SKU_DEV_MIDDLEWARE_ENABLED__: true,
__SKU_DEV_MIDDLEWARE_PATH__: true,
__SKU_LIBRARY_NAME__: true,
__SKU_LIBRARY_FILE__: true,
},
},

settings: {
react: {
version: '18.3.1',
},

'import-x/resolver': {
node: {
moduleDirectory: ['node_modules'],
},
},
},

rules: {
'jsdoc/check-alignment': 2,
'jsdoc/check-types': 2,

'jsdoc/no-multi-asterisks': [
'error',
{
allowWhitespace: true,
},
],

'jsdoc/require-asterisk-prefix': ['error', 'always'],
'no-console': 'off',
'no-process-exit': 'off',
'no-sync': 'off',

'import-x/no-unresolved': [
'error',
{
commonjs: true,
amd: true,

ignore: [
'__sku_alias__renderEntry',
'__sku_alias__serverEntry',
'__sku_alias__clientEntry',
'__sku_alias__webpackStats',
],
},
],

'one-var': ['error', 'never'],
'react/jsx-uses-react': 'off',
'react/react-in-jsx-scope': 'off',
'unicorn/prefer-node-protocol': 'error',
},
},
{
files: ['tests/**', 'test-utils/**'],

languageOptions: {
globals: {
...globals.jest,
browser: true,
},
},
},
];
10 changes: 0 additions & 10 deletions fixtures/assertion-removal/.eslintignore

This file was deleted.

2 changes: 1 addition & 1 deletion fixtures/assertion-removal/.gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# managed by sku
.eslintcache
.eslintrc
.prettierrc
coverage/
dist/
eslint.config.js
report/
tsconfig.json
# end managed by sku
2 changes: 1 addition & 1 deletion fixtures/assertion-removal/.prettierignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# managed by sku
.eslintcache
.eslintrc
.prettierrc
coverage/
dist/
eslint.config.js
pnpm-lock.yaml
report/
tsconfig.json
Expand Down
10 changes: 0 additions & 10 deletions fixtures/braid-design-system/.eslintignore

This file was deleted.

2 changes: 1 addition & 1 deletion fixtures/braid-design-system/.gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# managed by sku
.eslintcache
.eslintrc
.prettierrc
coverage/
dist/
eslint.config.js
report/
tsconfig.json
# end managed by sku
2 changes: 1 addition & 1 deletion fixtures/braid-design-system/.prettierignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# managed by sku
.eslintcache
.eslintrc
.prettierrc
coverage/
dist/
eslint.config.js
pnpm-lock.yaml
report/
tsconfig.json
Expand Down
10 changes: 0 additions & 10 deletions fixtures/custom-src-paths/.eslintignore

This file was deleted.

2 changes: 1 addition & 1 deletion fixtures/custom-src-paths/.gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# managed by sku
.eslintcache
.eslintrc
.prettierrc
coverage/
dist/
eslint.config.js
report/
tsconfig.json
# end managed by sku
2 changes: 1 addition & 1 deletion fixtures/custom-src-paths/.prettierignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# managed by sku
.eslintcache
.eslintrc
.prettierrc
coverage/
dist/
eslint.config.js
pnpm-lock.yaml
report/
tsconfig.json
Expand Down
10 changes: 0 additions & 10 deletions fixtures/library-build/.eslintignore

This file was deleted.

2 changes: 1 addition & 1 deletion fixtures/library-build/.gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# managed by sku
.eslintcache
.eslintrc
.prettierrc
coverage/
dist/
eslint.config.js
report/
tsconfig.json
# end managed by sku
2 changes: 1 addition & 1 deletion fixtures/library-build/.prettierignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# managed by sku
.eslintcache
.eslintrc
.prettierrc
coverage/
dist/
eslint.config.js
pnpm-lock.yaml
report/
tsconfig.json
Expand Down
Loading
Loading