froala / react-froala-wysiwyg

React component for Froala WYSIWYG HTML Rich Text Editor.
https://froala.com/wysiwyg-editor
562 stars 130 forks source link

Suppress warnings generated by froala_editor.pkgd.min.css #253

Open nathan-charrois opened 4 years ago

nathan-charrois commented 4 years ago

As per the readme we must import a node_modules file into our component

import 'froala-editor/css/froala_editor.pkgd.min.css';

However this causes warnings in ESlint

./node_modules/froala-editor/css/froala_editor.pkgd.min.css (./node_modules/css-loader/dist/cjs.js??ref--6-oneOf-3-1!./node_modules/postcss-loader/src??postcss!./node_modules/froala-editor/css/froala_editor.pkgd.min.css)
Warning

(7:52021) Replace fill-available to stretch, because spec had been changed

./node_modules/froala-editor/css/froala_editor.pkgd.min.css (./node_modules/css-loader/dist/cjs.js??ref--6-oneOf-3-1!./node_modules/postcss-loader/src??postcss!./node_modules/froala-editor/css/froala_editor.pkgd.min.css)
Warning

(7:53457) Replace fill-available to stretch, because spec had been changed

./node_modules/froala-editor/css/froala_editor.pkgd.min.css (./node_modules/css-loader/dist/cjs.js??ref--6-oneOf-3-1!./node_modules/postcss-loader/src??postcss!./node_modules/froala-editor/css/froala_editor.pkgd.min.css)
Warning

(7:54237) Replace fill-available to stretch, because spec had been changed

Any recommendations how to suppress these warnings? Because they are in an external CSS file they cannot be suppressed with // eslint-disable-next-line. .eslintignore already ignores files inside node_modules but I think because its being imported it's considered a local script.

Any ideas? Thanks

christofflueck commented 3 years ago

Any update on this? This is really annoying as it clutters the compile warnings

iicdii commented 3 years ago

I suppressed the message by add string-replace-loader in webpack config rules.

// webpack.config.js
module.exports = {
  // ...
  module: {
    rules: [
      {
        test: /froala_editor\.pkgd\.min\.css$/,
        loader: 'string-replace-loader',
        options: {
          search: /fill-available/g,
          replace: 'stretch'
        }
      }
    ]
  }
}
Acerbic commented 3 years ago

3.2.7 fixes it. I don't see warnings anymore