如何将 sass 用于 next.js
how to use sass for next.js
我正在为打字稿制作 Next.js 项目
我试过安装 sass
但是出现错误
Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser.
The file does not match your project config:
The file must be included in at least one of the projects provided.
添加包含项目next.config.js
但错误无法修复
我的.eslintrc.js
代码在那里
module.exports = {
env: {
browser: true,
es6: true,
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended'
],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
project: [
'./tsconfig.json'
],
sourceType: 'module',
},
plugins: [
'react',
'@typescript-eslint',
],
rules: {
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-member-accessibility': 'off',
'indent': 'off',
'@typescript-eslint/indent': ['error', 2],
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
'eol-last': ['error', 'always'],
'func-style': ['error', 'expression', {
allowArrowFunctions: true
}],
'newline-before-return': 'error',
'no-dupe-class-members': 'error',
'no-var': 'error',
'object-shorthand': ['error', 'always'],
'prefer-arrow-callback': 'error',
'prefer-const': 'error',
'prefer-spread': 'error',
'require-yield': 'error'
},
};
只要你看一下公式,好像运行没有问题,我认为是eslint的原因,但没有解决问题,有谁知道这个问题吗?
谢谢
在下一版本之前,使用 createDefaultProgram: true 可以作为 parserOptions 中的临时解决方案。
parserOptions: {
...,
createDefaultProgram: true,
},
这是已知问题。
https://github.com/typescript-eslint/typescript-eslint/issues/967
我正在为打字稿制作 Next.js 项目
我试过安装 sass
但是出现错误
Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser.
The file does not match your project config:
The file must be included in at least one of the projects provided.
添加包含项目next.config.js
但错误无法修复
我的.eslintrc.js
代码在那里
module.exports = {
env: {
browser: true,
es6: true,
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended'
],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
project: [
'./tsconfig.json'
],
sourceType: 'module',
},
plugins: [
'react',
'@typescript-eslint',
],
rules: {
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-member-accessibility': 'off',
'indent': 'off',
'@typescript-eslint/indent': ['error', 2],
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
'eol-last': ['error', 'always'],
'func-style': ['error', 'expression', {
allowArrowFunctions: true
}],
'newline-before-return': 'error',
'no-dupe-class-members': 'error',
'no-var': 'error',
'object-shorthand': ['error', 'always'],
'prefer-arrow-callback': 'error',
'prefer-const': 'error',
'prefer-spread': 'error',
'require-yield': 'error'
},
};
只要你看一下公式,好像运行没有问题,我认为是eslint的原因,但没有解决问题,有谁知道这个问题吗?
谢谢
在下一版本之前,使用 createDefaultProgram: true 可以作为 parserOptions 中的临时解决方案。
parserOptions: {
...,
createDefaultProgram: true,
},
这是已知问题。
https://github.com/typescript-eslint/typescript-eslint/issues/967