Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False Positive in PostCSS Config file: postcss.config.js #600

Closed
deadcoder0904 opened this issue Nov 9, 2020 · 4 comments
Closed

False Positive in PostCSS Config file: postcss.config.js #600

deadcoder0904 opened this issue Nov 9, 2020 · 4 comments

Comments

@deadcoder0904
Copy link

Bug Description

Gives false positive in PostCSS Config file.

Code snippets

I have the following postcss.config.js:

module.exports = {
	plugins: [
		'postcss-import',
		'tailwindcss',
		'postcss-flexbugs-fixes',
		[
			'postcss-preset-env',
			{
				autoprefixer: {
					flexbox: 'no-2009',
				},
				stage: 3,
				features: {
					'custom-properties': false,
				},
			},
		],
	],
}

The above syntax is for using PostCSS in combo with Next.js.

It's a little different syntax from the original postcss.config.js file. The original syntax uses require like:

module.exports = {
	plugins: [
		require('postcss-import'),
		require('tailwindcss'),
		require('postcss-flexbugs-fixes'),
		[
			require('postcss-preset-env'),
			{
				autoprefixer: {
					flexbox: 'no-2009',
				},
				stage: 3,
				features: {
					'custom-properties': false,
				},
			},
		],
	],
}

Where the dependency is listed in package.json:

{
	"dependencies": {
		"@mapbox/rehype-prism": "^0.5.0",
		"@mdx-js/react": "^1.6.19",
		"@types/nprogress": "^0.2.0",
		"fast-glob": "^3.2.4",
		"next": "10.0.1",
		"nprogress": "^0.2.0",
		"react": "^17.0.1",
		"react-dom": "^17.0.1",
		"tinytime": "^0.2.6",
		"unist-util-visit": "^2.0.3"
	},
	"devDependencies": {
		"@mdx-js/loader": "^1.6.19",
		"@next/bundle-analyzer": "^10.0.1",
		"@types/mdx-js__react": "^1.5.3",
		"@types/node": "^14.14.6",
		"@types/react": "^16.9.55",
		"@types/react-dom": "^16.9.9",
		"@types/webpack-env": "^1.15.3",
		"cross-env": "^7.0.2",
		"feed": "^4.2.1",
		"file-loader": "^6.2.0",
		"postcss-flexbugs-fixes": "^5.0.0",
		"postcss-import": "^13.0.0",
		"postcss-preset-env": "^6.7.0",
		"rimraf": "^3.0.2",
		"simple-functional-loader": "^1.2.1",
		"tailwindcss": "^1.9.6",
		"typescript": "4.0.5"
	},
	"license": "ISC"
}

Versions

  • node -v: v15.1.0
  • npm -v: 7.0.8
  • depcheck --version: 1.2.0

When I use depcheck it gives:

➜ depcheck         
Unused devDependencies
* @mdx-js/loader
* @types/react-dom
* @types/webpack-env
* postcss-flexbugs-fixes
* postcss-import
* postcss-preset-env

For cloning, just clone https://github.com/tailwindlabs/blog.tailwindcss.com & paste the above postcss.config.js as is (the one without the require syntax).

I've filed @mdx-js/loader issue which you've probably resolved, I haven't checked yet → #583

@types/react-dom & @types/webpack-env are used for TS but aren't included anywhere. Not sure if this issue is similar to #582

The last 3 starting with postcss-* are the bugs of this issue I think.

@stale
Copy link

stale bot commented Mar 16, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Mar 16, 2021
@stale stale bot closed this as completed Apr 7, 2021
@karlhorky
Copy link
Contributor

Is this actually stale? Or is this still an issue? I don't see a postcss.js file in the special folder

cc @rumpl

@rumpl
Copy link
Member

rumpl commented Jan 10, 2022

It's stale in a sense that no one is working on it for a long time so the bot closes it

@karlhorky
Copy link
Contributor

Ok no worries, should a new issue be opened? Or can this one be reopened?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants