Skip to content

Commit

Permalink
feat: use @rxts/eslint-plugin-prettier temporarily
Browse files Browse the repository at this point in the history
bump all (dev)Dependencies
  • Loading branch information
JounQin committed Mar 23, 2021
1 parent 9c8470e commit 46dde2e
Show file tree
Hide file tree
Showing 9 changed files with 376 additions and 625 deletions.
10 changes: 9 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
{
"extends": "@1stg"
"extends": "@1stg",
"overrides": [
{
"files": "*.mdx",
"globals": {
"Button": false
}
}
]
}
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,20 @@
"typecov": "type-coverage"
},
"devDependencies": {
"@angular/core": "^11.2.5",
"@types/jest": "^26.0.20",
"@types/node": "^14.14.34",
"@angular/core": "^11.2.6",
"@types/jest": "^26.0.21",
"@types/node": "^14.14.35",
"@types/react": "^17.0.3",
"@types/unist": "^2.0.3",
"core-js": "^3.9.1",
"lerna": "^4.0.0",
"npm-run-all": "^4.1.5",
"react": "^17.0.1",
"react": "^17.0.2",
"rxjs": "^6.6.6",
"svelte": "^3.35.0",
"ts-jest": "^26.5.3",
"ts-jest": "^26.5.4",
"tslint": "^6.1.3",
"type-coverage": "^2.16.3",
"type-coverage": "^2.17.0",
"typescript": "^4.1.5",
"vue": "^2.6.12",
"yarn-deduplicate": "^3.1.0"
Expand Down
4 changes: 2 additions & 2 deletions packages/babel-preset/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@babel/helper-plugin-utils": "^7.13.0",
"@babel/plugin-proposal-class-properties": "^7.13.0",
"@babel/plugin-proposal-decorators": "^7.13.5",
"@babel/preset-env": "^7.13.10",
"@babel/preset-env": "^7.13.12",
"@babel/preset-react": "^7.12.13",
"@babel/preset-typescript": "^7.13.0",
"@pkgr/utils": "^0.6.0",
Expand All @@ -25,7 +25,7 @@
"babel-plugin-transform-async-to-promises": "^0.8.15",
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
"babel-plugin-transform-remove-console": "^6.9.4",
"babel-plugin-transform-typescript-metadata": "^0.3.1",
"babel-plugin-transform-typescript-metadata": "^0.3.2",
"babel-preset-proposal-typescript": "^2.0.0",
"core-js": "^3.9.1",
"fast-async": "^7.0.6"
Expand Down
52 changes: 20 additions & 32 deletions packages/eslint-config/overrides.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
const path = require('path')

const {
isAngularAvailable,
isReactAvailable,
isPkgAvailable,
isSvelteAvailable,
Expand All @@ -23,11 +22,15 @@ const configFile =
const jsBase = {
files: ['*.mjs', '*.js', '*.jsx'],
parser: '@babel/eslint-parser',
parserOptions: configFile && {
babelOptions: {
configFile,
},
},
parserOptions: configFile
? {
babelOptions: {
configFile,
},
}
: {
requireConfigFile: false,
},
plugins: ['@babel'],
rules: {
camelcase: [
Expand Down Expand Up @@ -191,6 +194,8 @@ const tsBase = {
'promise/catch-or-return': 0,
// ts itself has guaranteed it
'unicorn/no-array-callback-reference': 0,
// already handled by @typescript-eslint/no-extraneous-class
'unicorn/no-static-only-class': 0,
},
}

Expand Down Expand Up @@ -274,29 +279,6 @@ exports.tslint = {
},
}

exports.angular = [
{
files: [
'*.directive.ts',
'*.component.ts',
'*.interceptor.ts',
'*.guard.ts',
'*.module.ts',
'*.pipe.ts',
'*.service.ts',
'*.validator.ts',
'component.ts',
'module.ts',
],
rules: {
/**
* @link https://github.com/typescript-eslint/typescript-eslint/issues/3114
*/
'@typescript-eslint/no-extraneous-class': 0,
},
},
]

const reactJsx = {
extends: ['standard-react', 'plugin:react/recommended', 'prettier'],
settings: {
Expand All @@ -318,6 +300,7 @@ exports.react = [
eventHandlerPropPrefix: 'on',
},
],
'sonar/function-name': [2, { format: '^_?[a-zA-Z][a-zA-Z0-9]*\\$?$' }],
},
...reactJsx,
},
Expand Down Expand Up @@ -416,7 +399,7 @@ const nonSourceRules = {
}

exports.test = {
files: '**/{__test__,test,tests}/**/*.{js,jsx,mdx,mjs,svelte,ts,tsx,vue}',
files: '**/{__test__,test,tests}/**/*',
rules: nonSourceRules,
}

Expand All @@ -426,8 +409,13 @@ exports.jest = {
rules: exports.test.rules,
}

exports.scripts = {
files: '**/scripts/**/*',
rules: nonSourceRules,
}

exports.stories = {
files: '**/stories/**/*.{js,jsx,mdx,mjs,svelte,ts,tsx,vue}',
files: '**/stories/**/*',
rules: nonSourceRules,
}

Expand All @@ -442,7 +430,6 @@ exports.overrides = []
isPkgAvailable('@babel/core') && exports.js,
isTsAvailable && exports.ts,
isPkgAvailable('tslint') && lintFile && exports.tslint,
isAngularAvailable && exports.angular,
isReactAvailable && exports.react,
isReactAvailable && exports.reactHooks,
isReactAvailable && exports.reactTs,
Expand All @@ -452,6 +439,7 @@ exports.overrides = []
exports.mdx,
isPkgAvailable('jest') && exports.jest,
exports.test,
exports.scripts,
exports.stories,
exports.config,
exports.dTs,
Expand Down
18 changes: 9 additions & 9 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
"@babel/eslint-parser": "^7.13.10",
"@babel/eslint-plugin": "^7.13.10",
"@pkgr/utils": "^0.6.0",
"@typescript-eslint/eslint-plugin": "^4.17.0",
"@typescript-eslint/eslint-plugin-tslint": "^4.17.0",
"@typescript-eslint/parser": "^4.17.0",
"@typescript-eslint/eslint-plugin": "^4.19.0",
"@typescript-eslint/eslint-plugin-tslint": "^4.19.0",
"@typescript-eslint/parser": "^4.19.0",
"eslint-config-prettier": "^8.1.0",
"eslint-config-standard": "^16.0.2",
"eslint-config-standard-jsx": "^10.0.0",
Expand All @@ -24,18 +24,18 @@
"eslint-import-resolver-typescript": "^2.4.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jest": "^24.3.1",
"eslint-plugin-mdx": "^1.9.1",
"eslint-plugin-jest": "^24.3.2",
"eslint-plugin-mdx": "^1.11.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-prettier": "npm:@rxts/eslint-plugin-prettier@^3.4.0-1",
"eslint-plugin-promise": "^4.3.1",
"eslint-plugin-react": "^7.22.0",
"eslint-plugin-react": "^7.23.0",
"eslint-plugin-react-hooks": "^4.2.0",
"eslint-plugin-sonar": "^0.4.0",
"eslint-plugin-sonarjs": "^0.6.0",
"eslint-plugin-svelte": "^1.1.2",
"eslint-plugin-unicorn": "^28.0.2",
"eslint-plugin-vue": "^7.7.0"
"eslint-plugin-unicorn": "^29.0.0",
"eslint-plugin-vue": "^7.8.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/postcss-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"postcss-modules": "^4.0.0",
"postcss-normalize": "^9.0.0",
"postcss-preset-env": "^6.7.0",
"postcss-url": "^10.1.1"
"postcss-url": "^10.1.3"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/prettier-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"dependencies": {
"@prettier/plugin-pug": "^1.13.5",
"@prettier/plugin-ruby": "^1.5.3",
"@prettier/plugin-ruby": "^1.5.4",
"@prettier/plugin-xml": "^0.13.1",
"prettier-plugin-pkg": "^0.8.0",
"prettier-plugin-sh": "^0.6.0",
Expand Down
10 changes: 8 additions & 2 deletions tests/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ class Basic {
prop: string = content
}

const decorator: ClassDecorator = () => {
//
}

@decorator
export class Empty {}

interface X {
m: number
p?: Position
Expand Down Expand Up @@ -75,8 +82,7 @@ try {

/**
* unexpected on ts 4.2, related to:
* @link https://github.com/ReactiveX/rxjs/issues/6060
* @link https://community.sonarsource.com/t/unexpected-deprecation-warnings-reported/39441
* @link https://github.com/microsoft/TypeScript/issues/43053
*/
interval(1000).subscribe()

Expand Down
Loading

0 comments on commit 46dde2e

Please sign in to comment.