forked from pixijs/pixi-react
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* remove docz related stuff * move code into separate packages with appropriate tooling * add nx config and ensure all package scripts run from repo root * move shared deps to root package.json * fix husky * move TYPES to separate package for easier sharing * add global eslint configuration dynamically pulling in patterns from packages * ignore eslintcache * switch yarn commands to npm Co-authored-by: Alex Prokop <[email protected]>
- Loading branch information
Showing
156 changed files
with
28,751 additions
and
14,685 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,50 @@ | ||
// In this monorepo linting is set up per workspace following the example from turborepo: | ||
// https://turbo.build/repo/docs/handbook/linting | ||
// Setting up the configs as modules works really nicely for parallelization and to handle includes/excludes, which can get | ||
// super messy globally, but it doesn't play nicely with husky at all, which expects to be able to lint globally. It also | ||
// doesn't easily allow us to lint the scripts and shared folders along with random root js files. This config exists to | ||
// handle these problems and dynamically shepherds the package specific includes/excludes into a single global config. | ||
// TODO: can we fix/improve this somehow? | ||
|
||
const { existsSync, readdirSync } = require('fs'); | ||
const { join } = require('path'); | ||
|
||
const ignorePatterns = []; | ||
|
||
try | ||
{ | ||
const packages = readdirSync('packages'); | ||
|
||
for (const folder of packages) | ||
{ | ||
const packagePath = join('packages', folder); | ||
const eslintPath = join(packagePath, '.eslintrc.js'); | ||
|
||
if (existsSync(eslintPath)) | ||
{ | ||
// eslint-disable-next-line global-require | ||
const packageLintConfig = require(`./${eslintPath}`); | ||
const packagePatternToGlobalPattern = (packagePattern) => join('/', packagePath, packagePattern); | ||
|
||
ignorePatterns.push(...packageLintConfig.ignorePatterns.map(packagePatternToGlobalPattern)); | ||
} | ||
} | ||
} | ||
catch (err) | ||
{ | ||
console.error('Error reading ignorePatterns from packages', err); | ||
} | ||
|
||
module.exports = { | ||
extends: ['@pixi/eslint-config'], | ||
root: true, | ||
extends: ['pixi-react'], | ||
parserOptions: { | ||
project: ['./tsconfig.eslint.json', './packages/*/tsconfig.json'], | ||
project: ['tsconfig.eslint.json'], | ||
tsconfigRootDir: __dirname | ||
}, | ||
settings: { | ||
jsdoc: { | ||
mode: 'typescript', | ||
tagNamePreference: { | ||
method: 'method', | ||
function: 'function', | ||
extends: 'extends', | ||
typeParam: 'typeParam', | ||
api: 'api' | ||
} | ||
} | ||
}, | ||
rules: { | ||
'no-empty-function': 0, | ||
'no-prototype-builtins': 0, | ||
'spaced-comment': [1, 'always', { markers: ['/'] }], | ||
'@typescript-eslint/triple-slash-reference': [1, { path: 'always' }], | ||
'@typescript-eslint/consistent-type-imports': [1, { disallowTypeAnnotations: false }], | ||
'@typescript-eslint/no-parameter-properties': 1, | ||
'@typescript-eslint/type-annotation-spacing': 1, | ||
}, | ||
overrides: [ | ||
{ | ||
files: ['test/**'], | ||
rules: { | ||
'@typescript-eslint/no-unused-expressions': 0, | ||
'@typescript-eslint/dot-notation': [ | ||
0, | ||
{ | ||
allowPrivateClassPropertyAccess: true, | ||
allowProtectedClassPropertyAccess: true, | ||
allowIndexSignaturePropertyAccess: true | ||
} | ||
], | ||
'dot-notation': 0 | ||
}, | ||
env: { | ||
jest: true, | ||
} | ||
} | ||
ignorePatterns: [ | ||
...ignorePatterns, | ||
'dist', | ||
'node_modules' | ||
] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,4 @@ | ||
node_modules/ | ||
lib/ | ||
dist/ | ||
animated/react-pixi* | ||
legacy/react-pixi* | ||
examples/ | ||
.docz/ | ||
.yarn-error.log | ||
docs/ | ||
.idea | ||
node_modules/ | ||
**/dist/ | ||
.eslintcache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
npx lint-staged |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"extends": "nx/presets/npm.json", | ||
"$schema": "./node_modules/nx/schemas/nx-schema.json", | ||
"tasksRunnerOptions": { | ||
"default": { | ||
"runner": "@nrwl/nx-cloud", | ||
"options": { | ||
"cacheableOperations": [ | ||
"build", | ||
"lint", | ||
"test" | ||
], | ||
"accessToken": "ZjQ3OWVmMTAtMTBlYS00YmJkLTk1ZjMtNmM5MWQ0YWFhYzY4fHJlYWQtd3JpdGU=", | ||
"scan": true | ||
} | ||
} | ||
}, | ||
"targetDefaults": { | ||
"build": { | ||
"dependsOn": ["^build"] | ||
}, | ||
"test": { | ||
"dependsOn": ["^build"] | ||
} | ||
}, | ||
"namedInputs": { | ||
"default": [ | ||
"{projectRoot}/**/*", | ||
"{projectRoot}/dist" | ||
] | ||
}, | ||
"targets": { | ||
"build": { | ||
"inputs": [ | ||
"default" | ||
] | ||
} | ||
} | ||
} |
Oops, something went wrong.