Skip to content

Commit

Permalink
feat(ci-runner): add separate ci-runner package
Browse files Browse the repository at this point in the history
  • Loading branch information
AriPerkkio committed Nov 22, 2020
1 parent 35c79c6 commit 525ab3e
Show file tree
Hide file tree
Showing 7 changed files with 2,005 additions and 23 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/lint-remote-javascript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ jobs:
node-version: 12.11
- run: yarn install
- run: yarn build
- run: node dist --config configs/eslint-remote-tester.javascript.config.js
- run: yarn install
working-directory: ./configs
- run: yarn lint:javascript
working-directory: ./configs
env:
CI: true
5 changes: 4 additions & 1 deletion .github/workflows/lint-remote-typescript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ jobs:
node-version: 12.11
- run: yarn install
- run: yarn build
- run: node dist --config configs/eslint-remote-tester.typescript.config.js
- run: yarn install
working-directory: ./configs
- run: yarn lint:typescript
working-directory: ./configs
env:
CI: true
34 changes: 30 additions & 4 deletions configs/eslint-remote-tester.javascript.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,40 @@ module.exports = {
react: {
version: '16.13.1',
},
jest: {
version: 26,
},
},
plugins: ['node', 'react', 'react-hooks', 'prettier'],
plugins: [
'cypress',
'jest-dom',
'jest',
'jsx-a11y',
'mocha',
'node',
'prettier',
'react-hooks',
'react-redux',
'react',
'sonarjs',
'testing-library',
'unicorn',
],
extends: [
'eslint:all',
'plugin:react/all',
'plugin:react-hooks/recommended',
'plugin:prettier/recommended',
'plugin:cypress/recommended',
'plugin:jest-dom/recommended',
'plugin:jest/all',
'plugin:jsx-a11y/recommended',
'plugin:mocha/recommended',
'plugin:node/recommended',
'plugin:prettier/recommended',
'plugin:react-hooks/recommended',
'plugin:react-redux/recommended',
'plugin:react/all',
'plugin:sonarjs/recommended',
'plugin:testing-library/react',
'plugin:unicorn/recommended',
],
},
};
55 changes: 39 additions & 16 deletions configs/eslint-remote-tester.typescript.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = {
repositories,

/** Extensions of files under scanning */
extensions: ['ts', 'tsx'],
extensions: ['js', 'jsx', 'ts', 'tsx'],

/** Optional pattern used to exclude paths */
pathIgnorePattern,
Expand All @@ -25,6 +25,7 @@ module.exports = {
root: true,
env: {
es6: true,
node: true,
},
parser: '@typescript-eslint/parser',
parserOptions: {
Expand All @@ -38,33 +39,53 @@ module.exports = {
react: {
version: '16.13.1',
},
jest: {
version: 26,
},
},
plugins: [
'node',
'react',
'react-hooks',
'@typescript-eslint',
'cypress',
'jest-dom',
'jest',
'jsx-a11y',
'mocha',
'node',
'prettier',
'react-hooks',
'react-redux',
'react',
'sonarjs',
'testing-library',
'unicorn',
],
extends: [
'eslint:all',
'plugin:react/all',
'plugin:react-hooks/recommended',
'plugin:prettier/recommended',
'plugin:@typescript-eslint/all',
'plugin:cypress/recommended',
'plugin:jest-dom/recommended',
'plugin:jest/all',
'plugin:jsx-a11y/recommended',
'plugin:mocha/recommended',
'plugin:node/recommended',
'prettier/@typescript-eslint',
'plugin:prettier/recommended',
'plugin:react-hooks/recommended',
'plugin:react-redux/recommended',
'plugin:react/all',
'plugin:sonarjs/recommended',
'plugin:testing-library/react',
'plugin:unicorn/recommended',
],
rules: {
// Disable all '...a rule which requires parserServices to be generated...'
// since adding project specific parserOptions.project is not supported
// Disable all rules which require type information since adding
// project specific parserOptions.project is not supported
'@typescript-eslint/await-thenable': 'off',
'@typescript-eslint/dot-notation': 'off',
'@typescript-eslint/naming-convention': 'off',
'@typescript-eslint/no-base-to-string': 'off',
'@typescript-eslint/no-confusing-void-expression': 'off',
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/no-implied-eval': 'off',
'@typescript-eslint/no-for-in-array': 'off',
'@typescript-eslint/no-misused-promises': 'off',
'@typescript-eslint/no-throw-literal': 'off',
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'off',
'@typescript-eslint/no-unnecessary-condition': 'off',
'@typescript-eslint/no-unnecessary-qualifier': 'off',
Expand All @@ -83,14 +104,16 @@ module.exports = {
'@typescript-eslint/prefer-string-starts-ends-with': 'off',
'@typescript-eslint/promise-function-async': 'off',
'@typescript-eslint/require-array-sort-compare': 'off',
'@typescript-eslint/require-await': 'off',
'@typescript-eslint/restrict-plus-operands': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/return-await': 'off',
'@typescript-eslint/strict-boolean-expressions': 'off',
'@typescript-eslint/switch-exhaustiveness-check': 'off',
'@typescript-eslint/unbound-method': 'off',
'@typescript-eslint/no-for-in-array': 'off',
'@typescript-eslint/dot-notation': 'off',
'@typescript-eslint/no-implied-eval': 'off',
'@typescript-eslint/no-throw-literal': 'off',
'@typescript-eslint/require-await': 'off',
'@typescript-eslint/return-await': 'off',
},
},
};
34 changes: 34 additions & 0 deletions configs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "eslint-remote-tester-ci-runner",
"description": "Dependencies for CI lint runs",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"private": true,
"scripts": {
"lint:javascript": "node ../dist --config ./eslint-remote-tester.javascript.config.js",
"lint:typescript": "node ../dist --config ./eslint-remote-tester.typescript.config.js"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^4.8.1",
"@typescript-eslint/parser": "^4.8.1",
"eslint": "^7.13.0",
"eslint-config-prettier": "^6.15.0",
"eslint-plugin-cypress": "^2.11.2",
"eslint-plugin-jest": "^24.1.3",
"eslint-plugin-jest-dom": "^3.2.4",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-local-rules": "^0.1.1",
"eslint-plugin-mocha": "^8.0.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-react": "^7.21.5",
"eslint-plugin-react-hooks": "^4.2.0",
"eslint-plugin-react-redux": "^3.3.0",
"eslint-plugin-sonarjs": "^0.5.0",
"eslint-plugin-testing-library": "^3.10.0",
"eslint-plugin-unicorn": "^23.0.0",
"react": "16.13.1",
"typescript": "^4.0.5"
}
}
9 changes: 8 additions & 1 deletion configs/pathIgnorePattern.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,18 @@ module.exports = `(${[
'react-solitaire/lib/index\\.js',
'babel\\.js',
'chunk\\.js',
'bundle\\.js',
'react-dom\\.development\\.js',
'vendor\\.min\\.js',
'jquery-3\\.4\\.1\\.min\\.js',
'\\.min\\.js', // Any *.min.js
'Khan/perseus/lib',
'glortho/react-keydown/example/public',
'reach/reach-ui/packages/combobox/examples/cities\\.ts',
'reach/reach-ui/website/src/components/cities\\.js',
'reach/reach-ui/website/static/router/static',
'Automattic/wp-calypso/client/components/phone-input/data\\.js',
'test262-main\\.ts',
'sample_vis\\.test\\.mocks\\.ts',
].join('|')})`;

0 comments on commit 525ab3e

Please sign in to comment.