Dan Van Brunt
09/09/2021, 6:21 PMParsing error: “parserOptions.project” has been set for @typescript-eslint/parser.
The file does not match your project config: .eslintrc.js.
The file must be included in at least one of the projects provided.
Ross Coundon
09/09/2021, 6:35 PMDan Van Brunt
09/09/2021, 6:40 PM.eslintrc.json
and not .js
now ES isn’t trying to lint itFrank
thdxr
09/09/2021, 6:52 PMthdxr
09/09/2021, 6:53 PMthdxr
09/09/2021, 6:54 PM.eslintrc.js
in your .eslintignoreCamilo Bravo
09/09/2021, 9:55 PMtsconfig.json
within our node modules directory. Not sure why it is even looking there?
yarn start gives the following:
Using stage: dev
Preparing your SST app
Detected tsconfig.json
Transpiling source
Linting source
/Users/me/Projects/my-app/lib/MyStack.ts
0:0 error Parsing error: Cannot read file '/users/me/projects/my-app/node_modules/@serverless-stack/cli/tsconfig.json'
/Users/me/Projects/my-app/lib/index.ts
0:0 error Parsing error: Cannot read file '/users/me/Projects/my-app/node_modules/@serverless-stack/cli/tsconfig.json'
✖ 2 problems (2 errors, 0 warnings)
Camilo Bravo
09/09/2021, 9:58 PMCamilo Bravo
09/09/2021, 10:11 PMCamilo Bravo
09/09/2021, 10:19 PM{
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier",
"plugin:prettier/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2019,
"project": "./tsconfig.json",
"sourceType": "module"
},
"rules": {
"@typescript-eslint/no-floating-promises": [
"error"
],
"@typescript-eslint/no-unused-vars": [
"warn",
{
"argsIgnorePattern": "^_"
}
]
}
}
thdxr
09/09/2021, 10:20 PMthdxr
09/09/2021, 10:20 PMDan Van Brunt
09/09/2021, 11:56 PMtsconfig.json
file. I work with @Camilo BravoDan Van Brunt
09/09/2021, 11:57 PM.eslintrc.json
Dan Van Brunt
09/09/2021, 11:58 PMDan Van Brunt
09/10/2021, 12:01 AM.eslintrc.json
is referencing ./tsconfig
perhaps its being RUN by the default eslint inside SST cli resources which likely run inside node_modules and thus change what the root folder context is?thdxr
09/10/2021, 12:02 AMDan Van Brunt
09/10/2021, 12:02 AMRoss Coundon
09/10/2021, 6:46 AMRoss Coundon
09/10/2021, 6:47 AMDan Van Brunt
09/10/2021, 3:00 PMthdxr
09/10/2021, 3:14 PMRoss Coundon
09/10/2021, 3:23 PM{
"compilerOptions": {
"plugins": [
{
"transform": "ts-optchain/transform"
}
],
"typeRoots": [
"./types",
"./node_modules/@types"
],
"resolveJsonModule": true,
"target": "ES2019",
"module": "commonjs",
"allowJs": true,
"checkJs": false,
"sourceMap": true,
"outDir": "./.build",
"removeComments": false,
"strict": true,
"noImplicitAny": true,
"esModuleInterop": true,
"inlineSourceMap": false,
"inlineSources": false,
"skipLibCheck": true,
"declarationMap": true,
"declaration": true,
"preserveConstEnums": true,
"baseUrl": "src",
"experimentalDecorators": true,
"paths": {
"@/*": [
"main/*"
]
}
},
"exclude": [
"./jest.config.js",
"./node_modules/**/*",
"./build/**/*"
],
"include": [
"lib",
"src"
]
}
Note it has lib (where sst is located) and srcRoss Coundon
09/10/2021, 3:23 PMmodule.exports = {
root: true,
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
extends: ['plugin:@typescript-eslint/recommended', 'plugin:@typescript-eslint/recommended-requiring-type-checking'],
parserOptions: {
ecmaVersion: 2019, // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports,
tsconfigRootDir: __dirname,
project: './tsconfig.json',
files: '*.ts',
},
};
Ross Coundon
09/10/2021, 3:24 PMDan Van Brunt
09/10/2021, 3:25 PMRoss Coundon
09/10/2021, 3:25 PMmodule.exports = {
semi: true,
trailingComma: 'all',
singleQuote: true,
printWidth: 130,
tabWidth: 2,
};
Dan Van Brunt
09/10/2021, 3:25 PMDan Van Brunt
09/10/2021, 3:26 PMRoss Coundon
09/10/2021, 3:26 PMDan Van Brunt
09/10/2021, 3:27 PMtsconfigRootDir: __dirname,
is it.Dan Van Brunt
09/10/2021, 3:31 PM.eslintignore
?Dan Van Brunt
09/10/2021, 3:35 PM.eslintrc.js
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
'plugin:prettier/recommended'
],
Dan Van Brunt
09/10/2021, 3:35 PMDan Van Brunt
09/10/2021, 3:35 PMRoss Coundon
09/10/2021, 3:37 PM# don't ever lint node_modules
node_modules
# don't lint build output (make sure it's set to your correct build folder name)
build
# don't lint nyc coverage output
coverage
babel.config.js
jest.config.js
.eslintrc.js
Ross Coundon
09/10/2021, 3:39 PMDan Van Brunt
09/10/2021, 3:39 PM.eslintignore
• eslintrc.js
= tsconfigRootDir: __dirname,
I think it was that second one that did it.Ross Coundon
09/10/2021, 3:40 PMDan Van Brunt
09/10/2021, 3:40 PMRoss Coundon
09/10/2021, 3:40 PMthdxr
09/10/2021, 3:40 PM